[cfe-commits] r94383 - /cfe/trunk/bindings/python/clang/cindex.py

Daniel Dunbar daniel at zuster.org
Sun Jan 24 13:19:48 PST 2010


Author: ddunbar
Date: Sun Jan 24 15:19:48 2010
New Revision: 94383

URL: http://llvm.org/viewvc/llvm-project?rev=94383&view=rev
Log:
Simplify.

Modified:
    cfe/trunk/bindings/python/clang/cindex.py

Modified: cfe/trunk/bindings/python/clang/cindex.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/bindings/python/clang/cindex.py?rev=94383&r1=94382&r2=94383&view=diff

==============================================================================
--- cfe/trunk/bindings/python/clang/cindex.py (original)
+++ cfe/trunk/bindings/python/clang/cindex.py Sun Jan 24 15:19:48 2010
@@ -48,11 +48,6 @@
     copy_string_vector(vec, strs)
     return vec
 
-# Aliases for convenience
-c_int_p = POINTER(c_int)
-c_uint_p = POINTER(c_uint)
-c_bool = c_uint
-
 # ctypes doesn't implicitly convert c_void_p to the appropriate wrapper
 # object. This is a problem, because it means that from_parameter will see an
 # integer and pass the wrong value on platforms where int != void*. Work around
@@ -338,8 +333,8 @@
 
 # Source Location Functions
 SourceLocation_loc = lib.clang_getInstantiationLocation
-SourceLocation_loc.argtypes = [SourceLocation, POINTER(c_object_p), c_uint_p,
-                               c_uint_p]
+SourceLocation_loc.argtypes = [SourceLocation, POINTER(c_object_p),
+                               POINTER(c_uint), POINTER(c_uint)]
 
 # Source Range Functions
 SourceRange_start = lib.clang_getRangeStart
@@ -354,45 +349,45 @@
 # TODO: Implement this function
 Cursor_get = lib.clang_getCursor
 Cursor_get.argtypes = [TranslationUnit, SourceLocation]
-Cursor.restype = Cursor
+Cursor_get.restype = Cursor
 
 Cursor_null = lib.clang_getNullCursor
 Cursor_null.restype = Cursor
 
 Cursor_kind = lib.clang_getCursorKind
 Cursor_kind.argtypes = [Cursor]
-Cursor_kind.res = c_int
+Cursor_kind.restype = c_int
 
 # FIXME: Not really sure what a USR is or what this function actually does...
 Cursor_usr = lib.clang_getCursorUSR
 
 Cursor_is_decl = lib.clang_isDeclaration
 Cursor_is_decl.argtypes = [CursorKind]
-Cursor_is_decl.restype = c_bool
+Cursor_is_decl.restype = bool
 
 Cursor_is_ref = lib.clang_isReference
 Cursor_is_ref.argtypes = [CursorKind]
-Cursor_is_ref.restype = c_bool
+Cursor_is_ref.restype = bool
 
 Cursor_is_expr = lib.clang_isExpression
 Cursor_is_expr.argtypes = [CursorKind]
-Cursor_is_expr.restype = c_bool
+Cursor_is_expr.restype = bool
 
 Cursor_is_stmt = lib.clang_isStatement
 Cursor_is_stmt.argtypes = [CursorKind]
-Cursor_is_stmt.restype = c_bool
+Cursor_is_stmt.restype = bool
 
 Cursor_is_inv = lib.clang_isInvalid
 Cursor_is_inv.argtypes = [CursorKind]
-Cursor_is_inv.restype = c_bool
+Cursor_is_inv.restype = bool
 
 Cursor_is_tu = lib.clang_isTranslationUnit
 Cursor_is_tu.argtypes = [CursorKind]
-Cursor_is_tu.restype = c_bool
+Cursor_is_tu.restype = bool
 
 Cursor_is_def = lib.clang_isCursorDefinition
 Cursor_is_def.argtypes = [Cursor]
-Cursor_is_def.restype = c_bool
+Cursor_is_def.restype = bool
 
 Cursor_def = lib.clang_getCursorDefinition
 Cursor_def.argtypes = [Cursor]





More information about the cfe-commits mailing list