Skip to content

Commit 932010e

Browse files
Update libmaxminddb and MySQL 5.7 (#2192)
* Update libmaxminddb and MySQL 5.7 (linux checkout) * Bump libmaxminddb version * Typo fix
1 parent 34ddf6d commit 932010e

File tree

8 files changed

+191
-110
lines changed

8 files changed

+191
-110
lines changed

extensions/geoip/data-pool.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
#ifndef _POSIX_C_SOURCE
2+
#define _POSIX_C_SOURCE 200809L
3+
#endif
4+
15
#include "data-pool.h"
26
#include "maxminddb.h"
37

48
#include <stdbool.h>
59
#include <stddef.h>
610
#include <stdlib.h>
711

8-
static bool can_multiply(size_t const, size_t const, size_t const);
9-
1012
// Allocate an MMDB_data_pool_s. It initially has space for size
1113
// MMDB_entry_data_list_s structs.
1214
MMDB_data_pool_s *data_pool_new(size_t const size) {
@@ -39,7 +41,7 @@ MMDB_data_pool_s *data_pool_new(size_t const size) {
3941
// the given max. max will typically be SIZE_MAX.
4042
//
4143
// We want to know if we'll wrap around.
42-
static bool can_multiply(size_t const max, size_t const m, size_t const n) {
44+
bool can_multiply(size_t const max, size_t const m, size_t const n) {
4345
if (m == 0) {
4446
return false;
4547
}

extensions/geoip/data-pool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typedef struct MMDB_data_pool_s {
4444
MMDB_entry_data_list_s *blocks[DATA_POOL_NUM_BLOCKS];
4545
} MMDB_data_pool_s;
4646

47+
bool can_multiply(size_t const, size_t const, size_t const);
4748
MMDB_data_pool_s *data_pool_new(size_t const);
4849
void data_pool_destroy(MMDB_data_pool_s *const);
4950
MMDB_entry_data_list_s *data_pool_alloc(MMDB_data_pool_s *const);

extensions/geoip/maxminddb-compat-util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4343
* SUCH DAMAGE.
4444
*/
45-
static void *
45+
static const void *
4646
mmdb_memmem(const void *l, size_t l_len, const void *s, size_t s_len) {
47-
register char *cur, *last;
47+
const char *cur, *last;
4848
const char *cl = (const char *)l;
4949
const char *cs = (const char *)s;
5050

@@ -61,9 +61,9 @@ mmdb_memmem(const void *l, size_t l_len, const void *s, size_t s_len) {
6161
return memchr(l, (int)*cs, l_len);
6262

6363
/* the last position where its possible to find "s" in "l" */
64-
last = (char *)cl + l_len - s_len;
64+
last = cl + l_len - s_len;
6565

66-
for (cur = (char *)cl; cur <= last; cur++)
66+
for (cur = cl; cur <= last; cur++)
6767
if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
6868
return cur;
6969

0 commit comments

Comments
 (0)