summaryrefslogtreecommitdiff
path: root/tutorial
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@apache.org>2008-02-06 22:18:40 +0000
committerDavid Reiss <dreiss@apache.org>2008-02-06 22:18:40 +0000
commit0c90f6f8af1d64ec9272bb2f6092336f3d0b8df8 (patch)
tree15245f459a76acc769d8fe99179176b4965bf66d /tutorial
parent3160971286aea0d5b28d5a7a87acaa8a12209ef8 (diff)
downloadthrift-0c90f6f8af1d64ec9272bb2f6092336f3d0b8df8.tar.gz
Thrift: Whitespace cleanup.
Summary: - Expanded tabs to spaces where spaces were the norm. - Deleted almost all trailing whitespace. - Added newlines to the ends of a few files. - Ran dos2unix on one file or two. Reviewed By: mcslee Test Plan: git diff -b Revert Plan: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tutorial')
-rw-r--r--tutorial/cpp/CppClient.cpp6
-rw-r--r--tutorial/java/src/JavaClient.java8
-rwxr-xr-xtutorial/php/PhpClient.php18
-rwxr-xr-xtutorial/py/PythonClient.py6
-rwxr-xr-xtutorial/py/PythonServer.py6
-rwxr-xr-xtutorial/rb/RubyClient.rb2
-rwxr-xr-xtutorial/tutorial.thrift2
7 files changed, 24 insertions, 24 deletions
diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp
index b97116062..a21125b2d 100644
--- a/tutorial/cpp/CppClient.cpp
+++ b/tutorial/cpp/CppClient.cpp
@@ -26,10 +26,10 @@ int main(int argc, char** argv) {
try {
transport->open();
-
+
client.ping();
printf("ping()\n");
-
+
int32_t sum = client.add(1,1);
printf("1+1=%d\n", sum);
@@ -50,7 +50,7 @@ int main(int argc, char** argv) {
work.num2 = 10;
int32_t diff = client.calculate(1, work);
printf("15-10=%d\n", diff);
-
+
// Note that C++ uses return by reference for complex types to avoid
// costly copy construction
SharedStruct ss;
diff --git a/tutorial/java/src/JavaClient.java b/tutorial/java/src/JavaClient.java
index 6667d6f62..753f0c62e 100644
--- a/tutorial/java/src/JavaClient.java
+++ b/tutorial/java/src/JavaClient.java
@@ -17,8 +17,8 @@ import java.util.ArrayList;
public class JavaClient {
public static void main(String [] args) {
try {
-
- TTransport transport = new TSocket("localhost", 9090);
+
+ TTransport transport = new TSocket("localhost", 9090);
TProtocol protocol = new TBinaryProtocol(transport);
Calculator.Client client = new Calculator.Client(protocol);
@@ -51,12 +51,12 @@ public class JavaClient {
} catch (InvalidOperation io) {
System.out.println("Invalid operation: " + io.why);
}
-
+
SharedStruct log = client.getStruct(1);
System.out.println("Check log: " + log.value);
transport.close();
-
+
} catch (TException x) {
x.printStackTrace();
}
diff --git a/tutorial/php/PhpClient.php b/tutorial/php/PhpClient.php
index fdd12ac5b..dc36f6da3 100755
--- a/tutorial/php/PhpClient.php
+++ b/tutorial/php/PhpClient.php
@@ -29,17 +29,17 @@ try {
$transport = new TBufferedTransport($socket, 1024, 1024);
$protocol = new TBinaryProtocol($transport);
$client = new CalculatorClient($protocol);
-
+
$transport->open();
-
+
$client->ping();
print "ping()\n";
-
+
$sum = $client->add(1,1);
print "1+1=$sum\n";
-
+
$work = new tutorial_Work();
-
+
$work->op = tutorial_Operation::DIVIDE;
$work->num1 = 1;
$work->num2 = 0;
@@ -50,18 +50,18 @@ try {
} catch (tutorial_InvalidOperation $io) {
print "InvalidOperation: $io->why\n";
}
-
+
$work->op = tutorial_Operation::SUBTRACT;
$work->num1 = 15;
$work->num2 = 10;
$diff = $client->calculate(1, $work);
print "15-10=$diff\n";
-
+
$log = $client->getStruct(1);
print "Log: $log->value\n";
-
+
$transport->close();
-
+
} catch (TException $tx) {
print 'TException: '.$tx->getMessage()."\n";
}
diff --git a/tutorial/py/PythonClient.py b/tutorial/py/PythonClient.py
index 9dcecd97c..05f17197c 100755
--- a/tutorial/py/PythonClient.py
+++ b/tutorial/py/PythonClient.py
@@ -35,7 +35,7 @@ try:
print '1+1=%d' % (sum)
work = Work()
-
+
work.op = Operation.DIVIDE
work.num1 = 1
work.num2 = 0
@@ -45,11 +45,11 @@ try:
print 'Whoa? You know how to divide by zero?'
except InvalidOperation, io:
print 'InvalidOperation: %s' % (io.__str__())
-
+
work.op = Operation.SUBTRACT
work.num1 = 15
work.num2 = 10
-
+
diff = client.calculate(1, work)
print '15-10=%d' % (diff)
diff --git a/tutorial/py/PythonServer.py b/tutorial/py/PythonServer.py
index 3324bbd55..111c44eb9 100755
--- a/tutorial/py/PythonServer.py
+++ b/tutorial/py/PythonServer.py
@@ -16,7 +16,7 @@ from thrift.server import TServer
class CalculatorHandler:
def __init__(self):
self.log = {}
-
+
def ping(self):
print 'ping()'
@@ -26,7 +26,7 @@ class CalculatorHandler:
def calculate(self, logid, work):
print 'calculate(%d, %s)' % (logid, work.__str__())
-
+
if work.op == Operation.ADD:
val = work.num1 + work.num2
elif work.op == Operation.SUBTRACT:
@@ -59,7 +59,7 @@ class CalculatorHandler:
def zip(self):
print 'zip()'
-
+
handler = CalculatorHandler()
processor = Calculator.Processor(handler)
transport = TSocket.TServerSocket(9090)
diff --git a/tutorial/rb/RubyClient.rb b/tutorial/rb/RubyClient.rb
index 9ee6e7942..d40ff4964 100755
--- a/tutorial/rb/RubyClient.rb
+++ b/tutorial/rb/RubyClient.rb
@@ -9,7 +9,7 @@ require 'Calculator'
begin
port = ARGV[0] || 9090
-
+
transport = TBufferedTransport.new(TSocket.new('localhost', port))
protocol = TBinaryProtocol.new(transport)
client = Calculator::Client.new(protocol)
diff --git a/tutorial/tutorial.thrift b/tutorial/tutorial.thrift
index f5e583640..323c96ab1 100755
--- a/tutorial/tutorial.thrift
+++ b/tutorial/tutorial.thrift
@@ -98,7 +98,7 @@ exception InvalidOperation {
* and can optionally inherit from another service using the extends keyword.
*/
service Calculator extends shared.SharedService {
-
+
/**
* A method definition looks like C code. It has a return type, arguments,
* and optionally a list of exceptions that it may throw. Note that argument