Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
163be5fd
Commit
163be5fd
authored
Aug 22, 2020
by
Monty
Committed by
Sergei Golubchik
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove compiler warnings regarding signed/unsigned compare in mroonga
parent
e42130e9
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
165 additions
and
151 deletions
+165
-151
storage/mroonga/vendor/groonga/include/groonga/groonga.h
storage/mroonga/vendor/groonga/include/groonga/groonga.h
+1
-1
storage/mroonga/vendor/groonga/lib/expr.c
storage/mroonga/vendor/groonga/lib/expr.c
+10
-10
storage/mroonga/vendor/groonga/lib/geo.c
storage/mroonga/vendor/groonga/lib/geo.c
+2
-1
storage/mroonga/vendor/groonga/lib/hash.c
storage/mroonga/vendor/groonga/lib/hash.c
+2
-2
storage/mroonga/vendor/groonga/lib/ii.c
storage/mroonga/vendor/groonga/lib/ii.c
+37
-38
storage/mroonga/vendor/groonga/lib/index_column.c
storage/mroonga/vendor/groonga/lib/index_column.c
+2
-1
storage/mroonga/vendor/groonga/lib/io.c
storage/mroonga/vendor/groonga/lib/io.c
+13
-13
storage/mroonga/vendor/groonga/lib/load.c
storage/mroonga/vendor/groonga/lib/load.c
+3
-2
storage/mroonga/vendor/groonga/lib/logger.c
storage/mroonga/vendor/groonga/lib/logger.c
+2
-2
storage/mroonga/vendor/groonga/lib/normalizer.c
storage/mroonga/vendor/groonga/lib/normalizer.c
+4
-3
storage/mroonga/vendor/groonga/lib/operator.c
storage/mroonga/vendor/groonga/lib/operator.c
+19
-19
storage/mroonga/vendor/groonga/lib/output.c
storage/mroonga/vendor/groonga/lib/output.c
+1
-1
storage/mroonga/vendor/groonga/lib/pat.c
storage/mroonga/vendor/groonga/lib/pat.c
+39
-39
storage/mroonga/vendor/groonga/lib/proc/proc_column.c
storage/mroonga/vendor/groonga/lib/proc/proc_column.c
+6
-0
storage/mroonga/vendor/groonga/lib/scanner.c
storage/mroonga/vendor/groonga/lib/scanner.c
+1
-1
storage/mroonga/vendor/groonga/lib/store.c
storage/mroonga/vendor/groonga/lib/store.c
+3
-3
storage/mroonga/vendor/groonga/lib/tokenizer.c
storage/mroonga/vendor/groonga/lib/tokenizer.c
+7
-5
storage/mroonga/vendor/groonga/lib/tokenizers.c
storage/mroonga/vendor/groonga/lib/tokenizers.c
+10
-7
storage/mroonga/vendor/groonga/lib/util.c
storage/mroonga/vendor/groonga/lib/util.c
+1
-1
storage/mroonga/vendor/groonga/lib/window_function.c
storage/mroonga/vendor/groonga/lib/window_function.c
+2
-2
No files found.
storage/mroonga/vendor/groonga/include/groonga/groonga.h
View file @
163be5fd
...
...
@@ -1540,7 +1540,7 @@ GRN_API void grn_ctx_recv_handler_set(grn_ctx *,
} while (0)
#define GRN_BULK_POP(obj, value, type, default) do {\
if (GRN_BULK_VSIZE(obj) >= sizeof(type)) {
\
if ((size_t) GRN_BULK_VSIZE(obj) >= sizeof(type)) {
\
GRN_BULK_INCR_LEN((obj), -(sizeof(type)));\
value = *(type *)(GRN_BULK_CURR(obj));\
} else {\
...
...
storage/mroonga/vendor/groonga/lib/expr.c
View file @
163be5fd
...
...
@@ -529,7 +529,7 @@ typedef struct {
static
grn_expr_dfi
*
grn_expr_dfi_pop
(
grn_expr
*
expr
)
{
if
(
GRN_BULK_VSIZE
(
&
expr
->
dfi
)
>=
sizeof
(
grn_expr_dfi
))
{
if
(
(
size_t
)
GRN_BULK_VSIZE
(
&
expr
->
dfi
)
>=
sizeof
(
grn_expr_dfi
))
{
grn_expr_dfi
*
dfi
;
GRN_BULK_INCR_LEN
(
&
expr
->
dfi
,
-
((
ssize_t
)(
sizeof
(
grn_expr_dfi
))));
dfi
=
(
grn_expr_dfi
*
)
GRN_BULK_CURR
(
&
expr
->
dfi
);
...
...
@@ -1459,7 +1459,7 @@ grn_proc_call(grn_ctx *ctx, grn_obj *proc, int nargs, grn_obj *caller)
grn_proc_ctx
pctx
;
grn_obj
*
obj
=
NULL
,
**
args
;
grn_proc
*
p
=
(
grn_proc
*
)
proc
;
if
(
nargs
>
ctx
->
impl
->
stack_curr
)
{
return
GRN_INVALID_ARGUMENT
;
}
if
(
(
uint32_t
)
nargs
>
ctx
->
impl
->
stack_curr
)
{
return
GRN_INVALID_ARGUMENT
;
}
GRN_API_ENTER
;
if
(
grn_obj_is_selector_only_proc
(
ctx
,
proc
))
{
char
name
[
GRN_TABLE_MAX_KEY_SIZE
];
...
...
@@ -3841,7 +3841,7 @@ grn_expr_get_value(grn_ctx *ctx, grn_obj *expr, int offset)
grn_obj
*
res
=
NULL
;
grn_expr
*
e
=
(
grn_expr
*
)
expr
;
GRN_API_ENTER
;
if
(
0
<=
offset
&&
offset
<
e
->
values_size
)
{
if
(
0
<=
offset
&&
(
uint
)
offset
<
e
->
values_size
)
{
res
=
&
e
->
values
[
offset
];
}
GRN_API_RETURN
(
res
);
...
...
@@ -5386,7 +5386,7 @@ grn_scan_info_build_simple_and_operations(grn_ctx *ctx,
int
i
;
int
nth_sis
;
for
(
i
=
0
,
nth_sis
=
0
;
i
<
e
->
codes_curr
;
i
+=
3
,
nth_sis
++
)
{
for
(
i
=
0
,
nth_sis
=
0
;
(
uint
)
i
<
e
->
codes_curr
;
i
+=
3
,
nth_sis
++
)
{
grn_expr_code
*
target
=
e
->
codes
+
i
;
grn_expr_code
*
constant
=
e
->
codes
+
i
+
1
;
grn_expr_code
*
operator
=
e
->
codes
+
i
+
2
;
...
...
@@ -5454,7 +5454,7 @@ grn_scan_info_build_simple_and_operations(grn_ctx *ctx,
return
NULL
;
}
for
(
i
=
0
,
nth_sis
=
0
;
i
<
e
->
codes_curr
;
i
+=
3
,
nth_sis
++
)
{
for
(
i
=
0
,
nth_sis
=
0
;
(
uint
)
i
<
e
->
codes_curr
;
i
+=
3
,
nth_sis
++
)
{
grn_expr_code
*
target
=
e
->
codes
+
i
;
grn_expr_code
*
constant
=
e
->
codes
+
i
+
1
;
grn_expr_code
*
operator
=
e
->
codes
+
i
+
2
;
...
...
@@ -5920,7 +5920,7 @@ grn_table_select_index_equal(grn_ctx *ctx,
if
(
si
->
position
.
specified
)
{
while
((
posting
=
grn_ii_cursor_next_pos
(
ctx
,
ii_cursor
)))
{
if
(
posting
->
pos
==
si
->
position
.
start
)
{
if
(
(
int
)
posting
->
pos
==
si
->
position
.
start
)
{
break
;
}
}
...
...
@@ -6037,7 +6037,7 @@ grn_table_select_index_not_equal(grn_ctx *ctx,
if
(
si
->
position
.
specified
)
{
while
((
posting
=
grn_ii_cursor_next_pos
(
ctx
,
ii_cursor
)))
{
if
(
posting
->
pos
==
si
->
position
.
start
)
{
if
(
(
int
)
posting
->
pos
==
si
->
position
.
start
)
{
break
;
}
}
...
...
@@ -6561,7 +6561,7 @@ grn_table_select_index_range_column(grn_ctx *ctx, grn_obj *table,
if
(
si
->
position
.
specified
)
{
while
((
posting
=
grn_ii_cursor_next_pos
(
ctx
,
ii_cursor
)))
{
if
(
posting
->
pos
==
si
->
position
.
start
)
{
if
(
(
int
)
posting
->
pos
==
si
->
position
.
start
)
{
break
;
}
}
...
...
@@ -6849,7 +6849,7 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
grn_id
min_id
=
GRN_ID_NIL
;
v
=
grn_expr_get_var_by_offset
(
ctx
,
(
grn_obj
*
)
e
,
0
);
GRN_PTR_INIT
(
&
res_stack
,
GRN_OBJ_VECTOR
,
GRN_ID_NIL
);
for
(
i
=
0
;
i
<
scanner
->
n_sis
;
i
++
)
{
for
(
i
=
0
;
(
uint
)
i
<
scanner
->
n_sis
;
i
++
)
{
scan_info
*
si
=
scanner
->
sis
[
i
];
if
(
si
->
flags
&
SCAN_POP
)
{
grn_obj
*
res_
;
...
...
@@ -6897,7 +6897,7 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
i
=
0
;
if
(
!
res_created
)
{
i
++
;
}
for
(;
i
<
GRN_BULK_VSIZE
(
&
res_stack
)
/
sizeof
(
grn_obj
*
);
i
++
)
{
for
(;
(
uint
)
i
<
GRN_BULK_VSIZE
(
&
res_stack
)
/
sizeof
(
grn_obj
*
);
i
++
)
{
grn_obj
*
stacked_res
;
stacked_res
=
*
((
grn_obj
**
)
GRN_BULK_HEAD
(
&
res_stack
)
+
i
);
grn_obj_close
(
ctx
,
stacked_res
);
...
...
storage/mroonga/vendor/groonga/lib/geo.c
View file @
163be5fd
...
...
@@ -64,7 +64,8 @@ typedef struct {
static
int
compute_diff_bit
(
uint8_t
*
geo_key1
,
uint8_t
*
geo_key2
)
{
int
i
,
j
,
diff_bit
=
0
;
size_t
i
;
int
j
,
diff_bit
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
grn_geo_point
);
i
++
)
{
if
(
geo_key1
[
i
]
!=
geo_key2
[
i
])
{
...
...
storage/mroonga/vendor/groonga/lib/hash.c
View file @
163be5fd
...
...
@@ -2261,7 +2261,7 @@ grn_hash_lock(grn_ctx *ctx, grn_hash *hash, int timeout)
GRN_ATOMIC_ADD_EX
(
hash
->
lock
,
1
,
lock
);
if
(
lock
)
{
GRN_ATOMIC_ADD_EX
(
hash
->
lock
,
-
1
,
lock
);
if
(
!
timeout
||
(
timeout
>
0
&&
timeout
==
count
))
{
break
;
}
if
(
!
timeout
||
(
timeout
>
0
&&
(
uint32_t
)
timeout
==
count
))
{
break
;
}
if
(
!
(
++
_ncolls
%
1000000
)
&&
(
_ncolls
>
_ncalls
))
{
if
(
_ncolls
<
0
||
_ncalls
<
0
)
{
_ncolls
=
0
;
_ncalls
=
0
;
...
...
@@ -3350,7 +3350,7 @@ grn_hash_sort(grn_ctx *ctx, grn_hash *hash,
return
0
;
}
}
if
(
limit
>
*
hash
->
n_entries
)
{
limit
=
*
hash
->
n_entries
;
}
if
(
(
uint
)
limit
>
(
uint
)
*
hash
->
n_entries
)
{
limit
=
*
hash
->
n_entries
;
}
/* hash->limit = limit; */
if
(
optarg
)
{
int
dir
=
(
optarg
->
flags
&
GRN_TABLE_SORT_DESC
);
...
...
storage/mroonga/vendor/groonga/lib/ii.c
View file @
163be5fd
This diff is collapsed.
Click to expand it.
storage/mroonga/vendor/groonga/lib/index_column.c
View file @
163be5fd
...
...
@@ -66,7 +66,8 @@ grn_index_column_build_call_hook(grn_ctx *ctx, grn_obj *obj,
grn_obj
oldvalue
;
/* todo : grn_proc_ctx_open() */
grn_obj
id_
,
flags_
;
grn_proc_ctx
pctx
=
{{
0
},
hooks
->
proc
,
NULL
,
hooks
,
hooks
,
PROC_INIT
,
4
,
4
};
grn_proc_ctx
pctx
=
{{
0
},
hooks
->
proc
,
NULL
,
hooks
,
hooks
,
PROC_INIT
,
4
,
4
,
{{
0
}}};
GRN_TEXT_INIT
(
&
oldvalue
,
0
);
GRN_UINT32_INIT
(
&
id_
,
0
);
GRN_UINT32_INIT
(
&
flags_
,
0
);
...
...
storage/mroonga/vendor/groonga/lib/io.c
View file @
163be5fd
...
...
@@ -526,7 +526,7 @@ grn_io_detect_type(grn_ctx *ctx, const char *path)
grn_open
(
fd
,
path
,
O_RDONLY
|
GRN_OPEN_FLAG_BINARY
);
if
(
fd
!=
-
1
)
{
struct
stat
s
;
if
(
fstat
(
fd
,
&
s
)
!=
-
1
&&
s
.
st_size
>=
sizeof
(
struct
_grn_io_header
))
{
if
(
fstat
(
fd
,
&
s
)
!=
-
1
&&
(
size_t
)
s
.
st_size
>=
sizeof
(
struct
_grn_io_header
))
{
if
(
grn_read
(
fd
,
&
h
,
sizeof
(
struct
_grn_io_header
))
==
sizeof
(
struct
_grn_io_header
))
{
if
(
!
memcmp
(
h
.
idstr
,
GRN_IO_IDSTR
,
GRN_IO_IDSTR_LEN
))
{
...
...
@@ -593,7 +593,7 @@ grn_io_open(grn_ctx *ctx, const char *path, grn_io_mode mode)
grn_close
(
fd
);
return
NULL
;
}
if
(
s
.
st_size
<
sizeof
(
struct
_grn_io_header
))
{
if
(
(
size_t
)
s
.
st_size
<
sizeof
(
struct
_grn_io_header
))
{
ERR
(
GRN_INCOMPATIBLE_FILE_FORMAT
,
"[io][open] file size is too small: "
"<%"
GRN_FMT_INT64D
">(required: >= %"
GRN_FMT_SIZE
"): <%s>"
,
...
...
@@ -707,7 +707,7 @@ grn_io_close(grn_ctx *ctx, grn_io *io)
segment_size
=
io
->
header
->
segment_size
;
file_size
=
grn_io_compute_file_size
(
io
->
header
->
version
);
segments_per_file
=
file_size
/
segment_size
;
for
(
i
=
0
;
i
<
max_segment
;
i
++
)
{
for
(
i
=
0
;
(
uint
)
i
<
max_segment
;
i
++
)
{
grn_io_mapinfo
*
mi
;
mi
=
&
(
io
->
maps
[
i
]);
if
(
mi
->
map
)
{
...
...
@@ -726,7 +726,7 @@ grn_io_close(grn_ctx *ctx, grn_io *io)
GRN_MUNMAP
(
ctx
,
&
grn_gctx
,
io
,
(
io
->
fis
?
&
io
->
fis
->
fmo
:
NULL
),
io
->
fis
,
io
->
header
,
io
->
base
);
if
(
io
->
fis
)
{
int
i
;
u
int
i
;
for
(
i
=
0
;
i
<
max_nfiles
;
i
++
)
{
fileinfo
*
fi
=
&
(
io
->
fis
[
i
]);
grn_fileinfo_close
(
ctx
,
fi
);
...
...
@@ -797,7 +797,7 @@ grn_io_n_files(grn_ctx *ctx, grn_io *io)
grn_rc
grn_io_size
(
grn_ctx
*
ctx
,
grn_io
*
io
,
uint64_t
*
size
)
{
in
t
fno
;
uint32_
t
fno
;
struct
stat
s
;
uint64_t
tsize
=
0
;
char
buffer
[
PATH_MAX
];
...
...
@@ -930,7 +930,7 @@ grn_io_read_ja(grn_io *io, grn_ctx *ctx, grn_io_ja_einfo *einfo, uint32_t epos,
*
value_len
=
0
;
return
GRN_NO_MEMORY_AVAILABLE
;
}
if
(
pos
+
size
>
file_size
)
{
if
(
(
unsigned
long
)
(
pos
+
size
)
>
file_size
)
{
rest
=
pos
+
size
-
file_size
;
size
=
file_size
-
pos
;
}
...
...
@@ -1026,7 +1026,7 @@ grn_io_write_ja(grn_io *io, grn_ctx *ctx, uint32_t key,
fileinfo
*
fi
=
&
io
->
fis
[
fno
];
off_t
base
=
fno
?
0
:
io
->
base
-
(
uint64_t
)
segment_size
*
io
->
base_seg
;
off_t
pos
=
(
uint64_t
)
segment_size
*
(
bseg
%
segments_per_file
)
+
offset
+
base
;
if
(
pos
+
size
>
file_size
)
{
if
(
(
unsigned
long
)
(
pos
+
size
)
>
file_size
)
{
rest
=
pos
+
size
-
file_size
;
size
=
file_size
-
pos
;
}
...
...
@@ -1303,7 +1303,7 @@ grn_io_expire(grn_ctx *ctx, grn_io *io, int count_thresh, uint32_t limit)
{
uint32_t
nref
,
nmaps
,
*
pnref
=
&
io
->
nref
;
GRN_ATOMIC_ADD_EX
(
pnref
,
1
,
nref
);
if
(
!
nref
&&
grn_gtick
-
io
->
count
>
count_thresh
)
{
if
(
!
nref
&&
grn_gtick
-
io
->
count
>
(
uint
)
count_thresh
)
{
{
uint32_t
i
=
io
->
header
->
n_arrays
;
grn_io_array_spec
*
array_specs
=
(
grn_io_array_spec
*
)
io
->
user_header
;
...
...
@@ -1341,10 +1341,10 @@ grn_io_expire(grn_ctx *ctx, grn_io *io, int count_thresh, uint32_t limit)
{
grn_io_mapinfo
*
info
=
io
->
maps
;
for
(
m
=
io
->
max_map_seg
;
n
<
limit
&&
m
;
info
++
,
m
--
)
{
if
(
info
->
map
&&
(
grn_gtick
-
info
->
count
)
>
count_thresh
)
{
if
(
info
->
map
&&
(
grn_gtick
-
info
->
count
)
>
(
uint
)
count_thresh
)
{
uint32_t
nmaps
,
nref
,
*
pnref
=
&
info
->
nref
;
GRN_ATOMIC_ADD_EX
(
pnref
,
1
,
nref
);
if
(
!
nref
&&
info
->
map
&&
(
grn_gtick
-
info
->
count
)
>
count_thresh
)
{
if
(
!
nref
&&
info
->
map
&&
(
grn_gtick
-
info
->
count
)
>
(
uint
)
count_thresh
)
{
GRN_MUNMAP
(
ctx
,
&
grn_gctx
,
io
,
&
info
->
fmo
,
NULL
,
info
->
map
,
io
->
header
->
segment_size
);
GRN_ATOMIC_ADD_EX
(
&
io
->
nmaps
,
-
1
,
nmaps
);
...
...
@@ -1395,7 +1395,7 @@ grn_io_lock(grn_ctx *ctx, grn_io *io, int timeout)
"io(%s) collisions(%d/%d): lock failed %d times"
,
io
->
path
,
_ncolls
,
_ncalls
,
count_log_border
);
}
if
(
!
timeout
||
(
timeout
>
0
&&
timeout
==
count
))
{
if
(
!
timeout
||
(
timeout
>
0
&&
timeout
==
(
int
)
count
))
{
GRN_LOG
(
ctx
,
GRN_LOG_WARNING
,
"[DB Locked] time out(%d): io(%s) collisions(%d/%d)"
,
timeout
,
io
->
path
,
_ncolls
,
_ncalls
);
...
...
@@ -2166,7 +2166,7 @@ inline static grn_rc
grn_pread
(
grn_ctx
*
ctx
,
fileinfo
*
fi
,
void
*
buf
,
size_t
count
,
off_t
offset
)
{
ssize_t
r
=
pread
(
fi
->
fd
,
buf
,
count
,
offset
);
if
(
r
!=
count
)
{
if
(
r
!=
(
ssize_t
)
count
)
{
if
(
r
==
-
1
)
{
SERR
(
"pread"
);
}
else
{
...
...
@@ -2184,7 +2184,7 @@ inline static grn_rc
grn_pwrite
(
grn_ctx
*
ctx
,
fileinfo
*
fi
,
void
*
buf
,
size_t
count
,
off_t
offset
)
{
ssize_t
r
=
pwrite
(
fi
->
fd
,
buf
,
count
,
offset
);
if
(
r
!=
count
)
{
if
(
r
!=
(
ssize_t
)
count
)
{
if
(
r
==
-
1
)
{
SERR
(
"pwrite"
);
}
else
{
...
...
storage/mroonga/vendor/groonga/lib/load.c
View file @
163be5fd
...
...
@@ -468,7 +468,8 @@ bracket_close(grn_ctx *ctx, grn_loader *loader)
}
for
(
i
=
0
;
i
<
nvalues
;
i
++
,
value
=
values_next
(
ctx
,
value
))
{
if
(
i
==
loader
->
id_offset
||
i
==
loader
->
key_offset
)
{
if
((
uint
)
i
==
(
uint
)
loader
->
id_offset
||
(
uint
)
i
==
(
uint
)
loader
->
key_offset
)
{
/* Skip _id and _key, because it's already used to get id. */
continue
;
}
...
...
@@ -532,7 +533,7 @@ brace_close(grn_ctx *ctx, grn_loader *loader)
GRN_ASSERT
(
value
->
header
.
domain
==
GRN_JSON_LOAD_OPEN_BRACE
);
GRN_UINT32_SET
(
ctx
,
value_begin
,
loader
->
values_size
-
begin
-
1
);
value_begin
++
;
if
(
GRN_BULK_VSIZE
(
&
loader
->
level
)
>
sizeof
(
uint32_t
)
*
loader
->
emit_level
)
{
if
(
(
size_t
)
GRN_BULK_VSIZE
(
&
loader
->
level
)
>
sizeof
(
uint32_t
)
*
loader
->
emit_level
)
{
return
;
}
if
(
!
loader
->
table
)
{
...
...
storage/mroonga/vendor/groonga/lib/logger.c
View file @
163be5fd
...
...
@@ -495,9 +495,9 @@ grn_query_log_flags_parse(const char *string,
}
#define CHECK_FLAG(name) \
if (((string_end - string) >= (sizeof(#name) - 1)) && \
if (((s
ize_t) (s
tring_end - string) >= (sizeof(#name) - 1)) && \
(memcmp(string, #name, sizeof(#name) - 1) == 0) && \
(((string_end - string) == (sizeof(#name) - 1)) || \
(((s
ize_t)(s
tring_end - string) == (sizeof(#name) - 1)) || \
(string[sizeof(#name) - 1] == '|') || \
(string[sizeof(#name) - 1] == ' '))) { \
*flags |= GRN_QUERY_LOG_ ## name; \
...
...
storage/mroonga/vendor/groonga/lib/normalizer.c
View file @
163be5fd
...
...
@@ -32,9 +32,10 @@ grn_normalizer_register(grn_ctx *ctx,
grn_proc_func
*
next
,
grn_proc_func
*
fin
)
{
grn_expr_var
vars
[]
=
{
{
NULL
,
0
}
};
grn_expr_var
vars
[
1
];
vars
[
0
].
name
=
0
;
vars
[
0
].
name_size
=
0
;
GRN_PTR_INIT
(
&
vars
[
0
].
value
,
0
,
GRN_ID_NIL
);
if
(
name_length
<
0
)
{
...
...
storage/mroonga/vendor/groonga/lib/operator.c
View file @
163be5fd
...
...
@@ -168,31 +168,31 @@ grn_operator_to_exec_func(grn_operator op)
#define DO_EQ_SUB do {\
switch (y->header.domain) {\
case GRN_DB_INT8 :\
r = (
x_ == GRN_INT8_VALUE(y));
\
r = (
(unsigned char) x_ == (unsigned char) GRN_INT8_VALUE(y));
\
break;\
case GRN_DB_UINT8 :\
r = (x_ == GRN_UINT8_VALUE(y));\
break;\
case GRN_DB_INT16 :\
r = (
x_ == GRN_INT16_VALUE(y));
\
r = (
(int) x_ == (int) GRN_INT16_VALUE(y));
\
break;\
case GRN_DB_UINT16 :\
r = (x_ == GRN_UINT16_VALUE(y));\
break;\
case GRN_DB_INT32 :\
r = (
x_ == GRN_INT32_VALUE(y));
\
r = (
(int) x_ == (int) GRN_INT32_VALUE(y));
\
break;\
case GRN_DB_UINT32 :\
r = (
x_ == GRN_UINT32_VALUE(y));
\
r = (
(uint) x_ == GRN_UINT32_VALUE(y));
\
break;\
case GRN_DB_INT64 :\
r = (
x_ == GRN_INT64_VALUE(y));
\
r = (
(long long) x_ == GRN_INT64_VALUE(y));
\
break;\
case GRN_DB_TIME :\
r = (GRN_TIME_PACK(x_,0) == GRN_INT64_VALUE(y));\
break;\
case GRN_DB_UINT64 :\
r = (
x_ == GRN_UINT64_VALUE(y));
\
r = (
(unsigned long long) x_ == GRN_UINT64_VALUE(y));
\
break;\
case GRN_DB_FLOAT :\
r = ((x_ <= GRN_FLOAT_VALUE(y)) && (x_ >= GRN_FLOAT_VALUE(y)));\
...
...
@@ -203,7 +203,7 @@ grn_operator_to_exec_func(grn_operator op)
{\
const char *p_ = GRN_TEXT_VALUE(y);\
int i_ = grn_atoi(p_, p_ + GRN_TEXT_LEN(y), NULL);\
r = (
x_ == i_);
\
r = (
(int) x_ == i_);
\
}\
break;\
default :\
...
...
@@ -271,10 +271,10 @@ grn_operator_to_exec_func(grn_operator op)
break;\
case GRN_DB_INT64 :\
case GRN_DB_TIME :\
r = (
x_ == GRN_INT64_VALUE(y));
\
r = (
(long long) x_ == GRN_INT64_VALUE(y));
\
break;\
case GRN_DB_UINT64 :\
r = (
x_ == GRN_UINT64_VALUE(y));
\
r = (
(unsigned long long) x_ == GRN_UINT64_VALUE(y));
\
break;\
case GRN_DB_FLOAT :\
r = (x_ == GRN_TIME_PACK(GRN_FLOAT_VALUE(y), 0));\
...
...
@@ -405,31 +405,31 @@ grn_operator_exec_not_equal(grn_ctx *ctx, grn_obj *x, grn_obj *y)
r = (x_ op (uint8_t)(GRN_BOOL_VALUE(y) ? 1 : 0));\
break;\
case GRN_DB_INT8 :\
r = (
x_ op GRN_INT8_VALUE(y));
\
r = (
(signed char) x_ op GRN_INT8_VALUE(y));
\
break;\
case GRN_DB_UINT8 :\
r = (
x_ op GRN_UINT8_VALUE(y));
\
r = (
(unsigned char) x_ op GRN_UINT8_VALUE(y));
\
break;\
case GRN_DB_INT16 :\
r = (
x_ op GRN_INT16_VALUE(y));
\
r = (
(short) x_ op GRN_INT16_VALUE(y));
\
break;\
case GRN_DB_UINT16 :\
r = (
x_ op GRN_UINT16_VALUE(y));
\
r = (
(unsigned short) x_ op GRN_UINT16_VALUE(y));
\
break;\
case GRN_DB_INT32 :\
r = (
x_ op GRN_INT32_VALUE(y));
\
r = (
(int) x_ op GRN_INT32_VALUE(y));
\
break;\
case GRN_DB_UINT32 :\
r = (
x_ op GRN_UINT32_VALUE(y));
\
r = (
(uint) x_ op GRN_UINT32_VALUE(y));
\
break;\
case GRN_DB_INT64 :\
r = (
x_ op GRN_INT64_VALUE(y));
\
r = (
(long long) x_ op GRN_INT64_VALUE(y));
\
break;\
case GRN_DB_TIME :\
r = (GRN_TIME_PACK(x_,0) op GRN_INT64_VALUE(y));\
break;\
case GRN_DB_UINT64 :\
r = (
x_ op GRN_UINT64_VALUE(y));
\
r = (
(unsigned long long) x_ op GRN_UINT64_VALUE(y));
\
break;\
case GRN_DB_FLOAT :\
r = (x_ op GRN_FLOAT_VALUE(y));\
...
...
@@ -552,10 +552,10 @@ grn_operator_exec_not_equal(grn_ctx *ctx, grn_obj *x, grn_obj *y)
break;\
case GRN_DB_INT64 :\
case GRN_DB_TIME :\
r = (
x_ op GRN_INT64_VALUE(y));
\
r = (
(long long) x_ op GRN_INT64_VALUE(y));
\
break;\
case GRN_DB_UINT64 :\
r = (
x_ op GRN_UINT64_VALUE(y));
\
r = (
(unsigned long long) x_ op GRN_UINT64_VALUE(y));
\
break;\
case GRN_DB_FLOAT :\
r = (x_ op GRN_TIME_PACK(GRN_FLOAT_VALUE(y), 0));\
...
...
storage/mroonga/vendor/groonga/lib/output.c
View file @
163be5fd
...
...
@@ -774,7 +774,7 @@ grn_text_atoj(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
}
if
(
a
->
next
)
{
a
=
a
->
next
;
if
(
GRN_BULK_VSIZE
(
&
buf
)
>=
sizeof
(
grn_id
))
{
if
(
(
size_t
)
GRN_BULK_VSIZE
(
&
buf
)
>=
sizeof
(
grn_id
))
{
id
=
*
((
grn_id
*
)
GRN_BULK_HEAD
(
&
buf
));
}
else
{
id
=
GRN_ID_NIL
;
...
...
storage/mroonga/vendor/groonga/lib/pat.c
View file @
163be5fd
This diff is collapsed.
Click to expand it.
storage/mroonga/vendor/groonga/lib/proc/proc_column.c
View file @
163be5fd
...
...
@@ -479,6 +479,12 @@ void
grn_proc_init_column_rename
(
grn_ctx
*
ctx
)
{
grn_expr_var
vars
[
3
];
vars
[
0
].
name
=
NULL
;
vars
[
0
].
name_size
=
0
;
vars
[
1
].
name
=
NULL
;
vars
[
1
].
name_size
=
0
;
vars
[
2
].
name
=
NULL
;
vars
[
2
].
name_size
=
0
;
grn_plugin_expr_var_init
(
ctx
,
&
(
vars
[
0
]),
"table"
,
-
1
);
grn_plugin_expr_var_init
(
ctx
,
&
(
vars
[
1
]),
"name"
,
-
1
);
...
...
storage/mroonga/vendor/groonga/lib/scanner.c
View file @
163be5fd
...
...
@@ -58,7 +58,7 @@ grn_scanner_close(grn_ctx *ctx, grn_scanner *scanner)
}
if
(
scanner
->
sis
)
{
int
i
;
u
int
i
;
for
(
i
=
0
;
i
<
scanner
->
n_sis
;
i
++
)
{
grn_scan_info_close
(
ctx
,
scanner
->
sis
[
i
]);
}
...
...
storage/mroonga/vendor/groonga/lib/store.c
View file @
163be5fd
...
...
@@ -756,7 +756,7 @@ grn_ja_alloc(grn_ctx *ctx, grn_ja *ja, grn_id id,
if
(
SEGMENTS_AT
(
ja
,
i
))
{
j
=
i
;
}
else
{
if
(
i
==
j
+
n
)
{
if
(
i
==
(
uint
)
(
j
+
n
)
)
{
j
++
;
addr
=
grn_io_win_map
(
ja
->
io
,
ctx
,
iw
,
j
,
0
,
element_size
,
grn_io_wronly
);
if
(
!
addr
)
{
...
...
@@ -764,7 +764,7 @@ grn_ja_alloc(grn_ctx *ctx, grn_ja *ja, grn_id id,
return
GRN_NO_MEMORY_AVAILABLE
;
}
EHUGE_ENC
(
einfo
,
j
,
element_size
);
for
(;
j
<=
i
;
j
++
)
{
SEGMENTS_HUGE_ON
(
ja
,
j
);
}
for
(;
j
<=
(
int
)
i
;
j
++
)
{
SEGMENTS_HUGE_ON
(
ja
,
j
);
}
grn_io_unlock
(
ja
->
io
);
return
GRN_SUCCESS
;
}
...
...
@@ -862,7 +862,7 @@ grn_ja_alloc(grn_ctx *ctx, grn_ja *ja, grn_id id,
}
vp
=
&
ja
->
header
->
free_elements
[
m
-
JA_W_EINFO
];
if
(
!
vp
->
seg
)
{
int
i
=
0
;
u
int
i
=
0
;
while
(
SEGMENTS_AT
(
ja
,
i
))
{
if
(
++
i
>=
JA_N_DSEGMENTS
)
{
grn_io_unlock
(
ja
->
io
);
...
...
storage/mroonga/vendor/groonga/lib/tokenizer.c
View file @
163be5fd
...
...
@@ -292,11 +292,13 @@ grn_tokenizer_register(grn_ctx *ctx, const char *plugin_name_ptr,
grn_proc_func
*
init
,
grn_proc_func
*
next
,
grn_proc_func
*
fin
)
{
grn_expr_var
vars
[]
=
{
{
NULL
,
0
},
{
NULL
,
0
},
{
NULL
,
0
}
};
grn_expr_var
vars
[
3
];
vars
[
0
].
name
=
NULL
;
vars
[
0
].
name_size
=
0
;
vars
[
1
].
name
=
NULL
;
vars
[
1
].
name_size
=
0
;
vars
[
2
].
name
=
NULL
;
vars
[
2
].
name_size
=
0
;
GRN_TEXT_INIT
(
&
vars
[
0
].
value
,
0
);
GRN_TEXT_INIT
(
&
vars
[
1
].
value
,
0
);
GRN_UINT32_INIT
(
&
vars
[
2
].
value
,
0
);
...
...
storage/mroonga/vendor/groonga/lib/tokenizers.c
View file @
163be5fd
...
...
@@ -668,7 +668,7 @@ regexp_next(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
break
;
}
if
(
n_characters
==
ngram_unit
)
{
if
(
n_characters
==
(
uint
)
ngram_unit
)
{
break
;
}
}
...
...
@@ -676,7 +676,7 @@ regexp_next(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
if
(
tokenizer
->
is_overlapping
)
{
status
|=
GRN_TOKEN_OVERLAP
;
}
if
(
n_characters
<
ngram_unit
)
{
if
(
n_characters
<
(
uint
)
ngram_unit
)
{
status
|=
GRN_TOKEN_UNMATURED
;
}
tokenizer
->
is_overlapping
=
(
n_characters
>
1
);
...
...
@@ -835,11 +835,14 @@ grn_rc
grn_db_init_builtin_tokenizers
(
grn_ctx
*
ctx
)
{
grn_obj
*
obj
;
grn_expr_var
vars
[]
=
{
{
NULL
,
0
},
{
NULL
,
0
},
{
NULL
,
0
}
};
grn_expr_var
vars
[
3
];
vars
[
0
].
name
=
NULL
;
vars
[
0
].
name_size
=
0
;
vars
[
1
].
name
=
NULL
;
vars
[
1
].
name_size
=
0
;
vars
[
2
].
name
=
NULL
;
vars
[
2
].
name_size
=
0
;
GRN_TEXT_INIT
(
&
vars
[
0
].
value
,
0
);
GRN_TEXT_INIT
(
&
vars
[
1
].
value
,
0
);
GRN_UINT32_INIT
(
&
vars
[
2
].
value
,
0
);
...
...
storage/mroonga/vendor/groonga/lib/util.c
View file @
163be5fd
...
...
@@ -1155,7 +1155,7 @@ grn_geo_point_inspect(grn_ctx *ctx, grn_obj *buf, grn_obj *obj)
point
.
latitude
=
latitude
;
point
.
longitude
=
longitude
;
grn_gton
(
encoded
,
&
point
,
sizeof
(
grn_geo_point
));
for
(
i
=
0
;
i
<
sizeof
(
grn_geo_point
);
i
++
)
{
for
(
i
=
0
;
(
uint
)
i
<
sizeof
(
grn_geo_point
);
i
++
)
{
if
(
i
!=
0
)
{
GRN_TEXT_PUTS
(
ctx
,
buf
,
" "
);
}
...
...
storage/mroonga/vendor/groonga/lib/window_function.c
View file @
163be5fd
...
...
@@ -63,7 +63,7 @@ grn_window_next(grn_ctx *ctx, grn_window *window)
}
if
(
window
->
direction
==
GRN_WINDOW_DIRECTION_ASCENDING
)
{
if
(
window
->
current_index
>=
window
->
n_ids
)
{
if
(
(
unsigned
long
)
window
->
current_index
>=
window
->
n_ids
)
{
GRN_API_RETURN
(
GRN_ID_NIL
);
}
}
else
{
...
...
@@ -250,7 +250,7 @@ grn_expr_is_window_function_call(grn_ctx *ctx,
if
(
call
->
op
!=
GRN_OP_CALL
)
{
return
GRN_FALSE
;
}
if
(
call
->
nargs
!=
(
expr
->
codes_curr
-
1
))
{
if
(
(
unsigned
int
)
call
->
nargs
!=
(
expr
->
codes_curr
-
1
))
{
return
GRN_FALSE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment