@@ -138,7 +138,7 @@ typedef struct {
138138typedef struct {
139139 sqlite3_vtab_cursor base ; // Base class - must be first
140140
141- sqlite3_int64 * rowids ;
141+ int64_t * rowids ;
142142 double * distance ;
143143
144144 int size ;
@@ -1582,15 +1582,15 @@ static int vCursorFilterCommon (sqlite3_vtab_cursor *cur, int idxNum, const char
15821582
15831583 if (c -> row_count != k ) {
15841584 if (c -> rowids ) sqlite3_free (c -> rowids );
1585- c -> rowids = (sqlite3_int64 * )sqlite3_malloc (k * sizeof (sqlite3_int64 ));
1585+ c -> rowids = (int64_t * )sqlite3_malloc (k * sizeof (int64_t ));
15861586 if (c -> rowids == NULL ) return SQLITE_NOMEM ;
15871587
15881588 if (c -> distance ) sqlite3_free (c -> distance );
15891589 c -> distance = (double * )sqlite3_malloc (k * sizeof (double ));
15901590 if (c -> distance == NULL ) return SQLITE_NOMEM ;
15911591 }
15921592
1593- memset (c -> rowids , 0 , k * sizeof (sqlite3_int64 ));
1593+ memset (c -> rowids , 0 , k * sizeof (int64_t ));
15941594 for (int i = 0 ; i < k ; ++ i ) c -> distance [i ] = INFINITY ;
15951595
15961596 c -> size = 0 ;
@@ -1696,7 +1696,7 @@ static int vFullScanCursorEof (sqlite3_vtab_cursor *cur){
16961696static int vFullScanCursorColumn (sqlite3_vtab_cursor * cur , sqlite3_context * context , int iCol ) {
16971697 vFullScanCursor * c = (vFullScanCursor * )cur ;
16981698 if (iCol == VECTOR_COLUMN_ROWID ) {
1699- sqlite3_result_int64 (context , c -> rowids [c -> row_index ]);
1699+ sqlite3_result_int64 (context , ( sqlite3_int64 ) c -> rowids [c -> row_index ]);
17001700 } else if (iCol == VECTOR_COLUMN_DISTANCE ) {
17011701 sqlite3_result_double (context , c -> distance [c -> row_index ]);
17021702 }
@@ -1705,7 +1705,7 @@ static int vFullScanCursorColumn (sqlite3_vtab_cursor *cur, sqlite3_context *con
17051705
17061706static int vFullScanCursorRowid (sqlite3_vtab_cursor * cur , sqlite_int64 * pRowid ) {
17071707 vFullScanCursor * c = (vFullScanCursor * )cur ;
1708- * pRowid = c -> rowids [c -> row_index ];
1708+ * pRowid = ( sqlite_int64 ) c -> rowids [c -> row_index ];
17091709 return SQLITE_OK ;
17101710}
17111711
@@ -1739,17 +1739,17 @@ static inline int vFullScanFindMaxIndex (double *values, int n) {
17391739}
17401740
17411741static int vFullScanSortSlots (vFullScanCursor * c ) {
1742- int counter = 0 ;
1743- int row_count = c -> row_count ;
1744- double * distance = c -> distance ;
1745- sqlite3_int64 * rowids = c -> rowids ;
1742+ int counter = 0 ;
1743+ int row_count = c -> row_count ;
1744+ double * distance = c -> distance ;
1745+ int64_t * rowids = c -> rowids ;
17461746
17471747 for (int i = 0 ; i < row_count - 1 ; ++ i ) {
17481748 if (distance [i ] == INFINITY ) ++ counter ;
17491749 for (int j = i + 1 ; j < row_count ; ++ j ) {
17501750 if (distance [j ] < distance [i ]) {
17511751 SWAP (double , distance [i ], distance [j ]);
1752- SWAP (sqlite3_int64 , rowids [i ], rowids [j ]);
1752+ SWAP (int64_t , rowids [i ], rowids [j ]);
17531753 }
17541754 }
17551755 }
@@ -1786,7 +1786,7 @@ static int vFullScanRun (sqlite3 *db, vFullScanCursor *c, const void *v1, int v1
17861786
17871787 if (distance < c -> distance [c -> max_index ]) {
17881788 c -> distance [c -> max_index ] = distance ;
1789- c -> rowids [c -> max_index ] = sqlite3_column_int64 (vm , 0 );
1789+ c -> rowids [c -> max_index ] = ( int64_t ) sqlite3_column_int64 (vm , 0 );
17901790 c -> max_index = vFullScanFindMaxIndex (c -> distance , c -> row_count );
17911791 }
17921792 }
@@ -1811,7 +1811,7 @@ static int vQuantRunMemory(vFullScanCursor *c, uint8_t *v, vector_qtype qtype, i
18111811 const size_t total_stride = rowid_size + vector_size ;
18121812
18131813 double * distance = c -> distance ;
1814- int64_t * rowids = c -> rowids ;
1814+ int64_t * rowids = ( int64_t * ) c -> rowids ;
18151815 int max_index = c -> max_index ;
18161816 double current_max = distance [max_index ];
18171817
0 commit comments