Skip to content

Conversation

DeinAlptraum
Copy link
Contributor

Fix the type of the numResults field of CCRStructure, as pointed out here: #140539 (comment)

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:as-a-library libclang and C++ API labels Sep 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 15, 2025

@llvm/pr-subscribers-clang

Author: Jannick Kremer (DeinAlptraum)

Changes

Fix the type of the numResults field of CCRStructure, as pointed out here: #140539 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/158598.diff

1 Files Affected:

  • (modified) clang/bindings/python/clang/cindex.py (+1-1)
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 3398823836e62..071bd76f95906 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -3150,7 +3150,7 @@ def string(self) -> CompletionString:
 
 
 class CCRStructure(Structure):
-    _fields_ = [("results", POINTER(CodeCompletionResult)), ("numResults", c_int)]
+    _fields_ = [("results", POINTER(CodeCompletionResult)), ("numResults", c_uint)]
 
     results: NoSliceSequence[CodeCompletionResult]
     numResults: int

@DeinAlptraum
Copy link
Contributor Author

Python doesn't know what unsigned is so this shouldn't have any effect on the bindings

@DeinAlptraum DeinAlptraum merged commit 63dc07f into llvm:main Sep 16, 2025
16 checks passed
@DeinAlptraum DeinAlptraum deleted the fix-int branch September 16, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:as-a-library libclang and C++ API clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants