2
2
#include "vdbeInt.h"
3
3
#include "vdbe.h"
4
4
5
-
6
- inline int initOpFunc (OpFunc * o , size_t len )
5
+ static int initOpFunc (OpFunc * o , size_t len )
7
6
{
8
7
assert ( o != NULL );
9
8
@@ -17,41 +16,31 @@ inline int initOpFunc(OpFunc* o, size_t len)
17
16
return o -> buf == NULL ;
18
17
}
19
18
20
- inline int initOpFuncDefault (OpFunc * o )
19
+ static int initOpFuncDefault (OpFunc * o )
21
20
{
22
21
return initOpFunc (o , DEFAULT_OPFUNC_BUFLEN );
23
22
}
24
23
25
- static inline int resize_buf (OpFunc * o , int size )
24
+ static int resize_buf (OpFunc * o , int size )
26
25
{
27
- char * old_buf = o -> buf ;
28
- int write_offset = o -> writeNext - old_buf ;
29
- int read_offset = o -> readNext - old_buf ;
30
-
31
- int newsize = o -> end - old_buf ;
32
-
33
- for (; newsize < size ; newsize *= 2 );
34
-
35
- char * newbuf = realloc (old_buf , newsize );
36
-
37
- if (!newbuf )
38
- return -1 ;
39
-
40
- o -> buf = newbuf ;
41
-
42
- if (o -> buf != old_buf )
43
- {
44
- o -> writeNext = o -> buf + write_offset ;
45
- o -> readNext = o -> buf + read_offset ;
46
- }
47
-
48
- o -> end = o -> buf + newsize ;
49
- o -> len = newsize ;
50
- return 0 ;
26
+ char * old_buf = o -> buf ;
27
+ ptrdiff_t write_offset = o -> writeNext - old_buf ;
28
+ ptrdiff_t read_offset = o -> readNext - old_buf ;
29
+ ptrdiff_t newsize = o -> end - old_buf ;
30
+ while (newsize < size ) newsize *= 2 ;
31
+ char * newbuf = realloc (old_buf , newsize );
32
+ if (!newbuf ) return -1 ;
33
+ if (o -> buf != newbuf ) {
34
+ o -> writeNext = newbuf + write_offset ;
35
+ o -> readNext = newbuf + read_offset ;
36
+ o -> buf = newbuf ;
37
+ }
38
+ o -> end = o -> buf + newsize ;
39
+ o -> len = newsize ;
40
+ return 0 ;
51
41
}
52
42
53
-
54
- inline void freeOpFunc (OpFunc * func )
43
+ void freeOpFunc (OpFunc * func )
55
44
{
56
45
if (!func )
57
46
return ;
@@ -67,7 +56,7 @@ inline void freeOpFunc(OpFunc* func)
67
56
68
57
}
69
58
70
- static inline void shallowFreeOpFuncSetup (OpFuncSetup * stp )
59
+ static void shallowFreeOpFuncSetup (OpFuncSetup * stp )
71
60
{
72
61
free (stp );
73
62
}
@@ -77,7 +66,7 @@ static const char* OPFUNC_NOROWS_COLNAMES[] = {0};
77
66
static int OPFUNC_NOROWS_COLTYPES [] = {0 };
78
67
static size_t OPFUNC_NOROWS_BUFSIZE = 0 ;
79
68
80
- static inline OpFuncSetup * getNoRowsSetup ()
69
+ static OpFuncSetup * getNoRowsSetup ()
81
70
{
82
71
OpFuncSetup * stp = malloc (sizeof (OpFuncSetup ));
83
72
0 commit comments