]> git.cworth.org Git - apitrace/commitdiff
Minor code whitespace cleanup.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 21 Apr 2011 08:28:10 +0000 (09:28 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 21 Apr 2011 08:28:10 +0000 (09:28 +0100)
d3dshader.py
glxtrace.py
os_win32.cpp
retrace.py
trace.py
trace_write.cpp

index 24372e2aa9c46fc31a9850f0c471a4a83bb1ca67..08a2d7f624d404019ae46ec2800fd6a9f70feef2 100644 (file)
@@ -55,18 +55,18 @@ typedef HRESULT
     static HMODULE hD3DXModule = NULL; 
     static PD3DXDISASSEMBLESHADER pfnD3DXDisassembleShader = NULL;
 
-    if(firsttime) {
-        if(!hD3DXModule) {
+    if (firsttime) {
+        if (!hD3DXModule) {
             unsigned release;
             int version;
-            for(release = 0; release <= 1; ++release) {
+            for (release = 0; release <= 1; ++release) {
                 /* Version 41 corresponds to Mar 2009 version of DirectX Runtime / SDK */ 
-                for(version = 41; version >= 0; --version) {
+                for (version = 41; version >= 0; --version) {
                     char filename[256];
                     _snprintf(filename, sizeof(filename), 
                               "d3dx9%s%s%u.dll", release ? "" : "d", version ? "_" : "", version);
                     hD3DXModule = LoadLibraryA(filename);
-                    if(hD3DXModule)
+                    if (hD3DXModule)
                         goto found;
                 }
             }
@@ -75,19 +75,19 @@ found:
         }
 
         if (hD3DXModule)
-            if(!pfnD3DXDisassembleShader)
+            if (!pfnD3DXDisassembleShader)
                 pfnD3DXDisassembleShader = (PD3DXDISASSEMBLESHADER)GetProcAddress(hD3DXModule, "D3DXDisassembleShader");
 
         firsttime = FALSE;
     }
    
-    if(pfnD3DXDisassembleShader) {
+    if (pfnD3DXDisassembleShader) {
         LPD3DXBUFFER pDisassembly = NULL;
    
         if (pfnD3DXDisassembleShader( (DWORD *)tokens, FALSE, NULL, &pDisassembly) == D3D_OK)
             Trace::LiteralString((char *)pDisassembly->GetBufferPointer());
 
-        if(pDisassembly)
+        if (pDisassembly)
             pDisassembly->Release();
     }
 }
index a5317a4b74888f56c89142b29501a3c5832e3347..7f5426fd242559dd88374a0ca0d068aea9805b83 100644 (file)
@@ -77,7 +77,7 @@ if __name__ == '__main__':
     for f in api.functions:
         ptype = function_pointer_type(f)
         pvalue = function_pointer_value(f)
-        print '    if(!strcmp("%s", (const char *)procName)) {' % f.name
+        print '    if (!strcmp("%s", (const char *)procName)) {' % f.name
         print '        %s = (%s)procPtr;' % (pvalue, ptype)
         print '        return (__GLXextFuncPtr)&%s;' % (f.name,)
         print '    }'
index 57a7fbca452bf3090766870098b3861629fefcb6..6cddc552681db55863e1eaf01f1f1baac070c2ed 100644 (file)
@@ -110,7 +110,7 @@ long long GetTime(void)
 {
     static LARGE_INTEGER frequency;
     LARGE_INTEGER counter;
-    if(!frequency.QuadPart)
+    if (!frequency.QuadPart)
         QueryPerformanceFrequency(&frequency);
     QueryPerformanceCounter(&counter);
     return counter.QuadPart*1000000LL/frequency.QuadPart;
index 4169b26423513523fadc0989339598539ffa157b..27d0afe8879c94e6bb013ee34e4b33d9a5c7159b 100644 (file)
@@ -74,7 +74,7 @@ class ValueExtractor(stdapi.Visitor):
         length = '__a%s->values.size()' % array.id
         print '        %s = new %s[%s];' % (lvalue, array.type, length)
         index = '__j' + array.id
-        print '        for(size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length)
+        print '        for (size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length)
         try:
             self.visit(array.type, '%s[%s]' % (lvalue, index), '*__a%s->values[%s]' % (array.id, index))
         finally:
@@ -137,7 +137,7 @@ class ValueWrapper(stdapi.Visitor):
         print '    if (__a%s) {' % (array.id)
         length = '__a%s->values.size()' % array.id
         index = '__j' + array.id
-        print '        for(size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length)
+        print '        for (size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length)
         try:
             self.visit(array.type, '%s[%s]' % (lvalue, index), '*__a%s->values[%s]' % (array.id, index))
         finally:
@@ -166,7 +166,7 @@ class ValueWrapper(stdapi.Visitor):
             lvalue = "%s + %s" % (lvalue, i)
             rvalue = "__orig_result + %s" % (i,)
             entry = handle_entry(handle, rvalue) 
-            print '    for({handle.type} {i} = 0; {i} < {handle.range}; ++{i}) {{'.format(**locals())
+            print '    for ({handle.type} {i} = 0; {i} < {handle.range}; ++{i}) {{'.format(**locals())
             print '        {entry} = {lvalue};'.format(**locals())
             print '        if (retrace::verbosity >= 2)'
             print '            std::cout << "{handle.name} " << ({rvalue}) << " -> " << ({lvalue}) << "\\n";'.format(**locals())
index 7b2ba73941fa60c91aab68326b4838221b050a02..7d40cb7c5d9d8ad9cd3f78d34a23c39421bfc28f 100644 (file)
--- a/trace.py
+++ b/trace.py
@@ -152,7 +152,7 @@ class DumpImplementer(stdapi.Visitor):
         print '    __traceStruct%s(%s);' % (struct.id, instance)
 
     def visit_array(self, array, instance):
-        print '    if(%s) {' % instance
+        print '    if (%s) {' % instance
         index = '__i' + array.type.id
         print '        Trace::BeginArray(%s);' % (array.length,)
         print '        for (int %s = 0; %s < %s; ++%s) {' % (index, index, array.length, index)
@@ -175,7 +175,7 @@ class DumpImplementer(stdapi.Visitor):
         print '    Trace::LiteralBitmask(__bitmask%s_sig, %s);' % (bitmask.id, instance)
 
     def visit_pointer(self, pointer, instance):
-        print '    if(%s) {' % instance
+        print '    if (%s) {' % instance
         print '        Trace::BeginArray(1);'
         print '        Trace::BeginElement();'
         dump_instance(pointer.type, "*" + instance)
@@ -249,7 +249,7 @@ class Wrapper(stdapi.Visitor):
     def visit_interface(self, interface, instance):
         assert instance.startswith('*')
         instance = instance[1:]
-        print "    if(%s)" % instance
+        print "    if (%s)" % instance
         print "        %s = new %s(%s);" % (instance, interface_wrap_name(interface), instance)
 
 
@@ -258,7 +258,7 @@ class Unwrapper(Wrapper):
     def visit_interface(self, interface, instance):
         assert instance.startswith('*')
         instance = instance[1:]
-        print "    if(%s)" % instance
+        print "    if (%s)" % instance
         print "        %s = static_cast<%s *>(%s)->m_pInstance;" % (instance, interface_wrap_name(interface), instance)
 
 
index 3187b9972ab1ab125fad58f87199de81a8bc9547..dc1fee9807175411957db841193dc4b129ff832b 100644 (file)
@@ -44,7 +44,7 @@ namespace Trace {
 
 static gzFile g_gzFile = NULL;
 static void _Close(void) {
-    if(g_gzFile != NULL) {
+    if (g_gzFile != NULL) {
         gzclose(g_gzFile);
         g_gzFile = NULL;
     }
@@ -77,7 +77,7 @@ static void _Open(const char *szExtension) {
                 snprintf(szFileName, PATH_MAX, "%s%c%s.%s", szCurrentDir, PATH_SEP, szProcessName, szExtension);
  
             file = fopen(szFileName, "rb");
-            if(file == NULL)
+            if (file == NULL)
                 break;
  
             fclose(file);