Skip to content

Commit

Permalink
Add const to alloc-related thd methods
Browse files Browse the repository at this point in the history
Also update abi declarations. The abi itself is unchanged, since const
doesn't affect C-style exported name.
  • Loading branch information
FooBarrior committed May 29, 2023
1 parent 75cf3b6 commit 4e2deb3
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 148 deletions.
24 changes: 12 additions & 12 deletions include/mysql/plugin_audit.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/plugin_auth.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/plugin_data_type.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/plugin_encryption.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/plugin_ftparser.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/plugin_function.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/plugin_password_validation.h.pp
Expand Up @@ -307,22 +307,22 @@
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(THD*, size_t);
void *(*thd_calloc_func)(THD*, size_t);
char *(*thd_strdup_func)(THD*, const char *);
char *(*thd_strmake_func)(THD*, const char *, size_t);
void *(*thd_memdup_func)(THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(THD*,
void *(*thd_alloc_func)(const THD*, size_t);
void *(*thd_calloc_func)(const THD*, size_t);
char *(*thd_strdup_func)(const THD*, const char *);
char *(*thd_strmake_func)(const THD*, const char *, size_t);
void *(*thd_memdup_func)(const THD*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const THD*,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(THD* thd, size_t size);
void *thd_calloc(THD* thd, size_t size);
char *thd_strdup(THD* thd, const char *str);
char *thd_strmake(THD* thd, const char *str, size_t size);
void *thd_memdup(THD* thd, const void* str, size_t size);
void *thd_alloc(const THD* thd, size_t size);
void *thd_calloc(const THD* thd, size_t size);
char *thd_strdup(const THD* thd, const char *str);
char *thd_strmake(const THD* thd, const char *str, size_t size);
void *thd_memdup(const THD* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const THD* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);
}
Expand Down
24 changes: 12 additions & 12 deletions include/mysql/service_thd_alloc.h
Expand Up @@ -50,12 +50,12 @@ struct st_mysql_const_lex_string
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;

extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(MYSQL_THD, size_t);
void *(*thd_calloc_func)(MYSQL_THD, size_t);
char *(*thd_strdup_func)(MYSQL_THD, const char *);
char *(*thd_strmake_func)(MYSQL_THD, const char *, size_t);
void *(*thd_memdup_func)(MYSQL_THD, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD,
void *(*thd_alloc_func)(const MYSQL_THD, size_t);
void *(*thd_calloc_func)(const MYSQL_THD, size_t);
char *(*thd_strdup_func)(const MYSQL_THD, const char *);
char *(*thd_strmake_func)(const MYSQL_THD, const char *, size_t);
void *(*thd_memdup_func)(const MYSQL_THD, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const MYSQL_THD,
MYSQL_CONST_LEX_STRING *,
const char *, size_t, int);
} *thd_alloc_service;
Expand Down Expand Up @@ -92,23 +92,23 @@ extern struct thd_alloc_service_st {
@see alloc_root()
*/
void *thd_alloc(MYSQL_THD thd, size_t size);
void *thd_alloc(const MYSQL_THD thd, size_t size);
/**
@see thd_alloc()
*/
void *thd_calloc(MYSQL_THD thd, size_t size);
void *thd_calloc(const MYSQL_THD thd, size_t size);
/**
@see thd_alloc()
*/
char *thd_strdup(MYSQL_THD thd, const char *str);
char *thd_strdup(const MYSQL_THD thd, const char *str);
/**
@see thd_alloc()
*/
char *thd_strmake(MYSQL_THD thd, const char *str, size_t size);
char *thd_strmake(const MYSQL_THD thd, const char *str, size_t size);
/**
@see thd_alloc()
*/
void *thd_memdup(MYSQL_THD thd, const void* str, size_t size);
void *thd_memdup(const MYSQL_THD thd, const void* str, size_t size);

/**
Create a LEX_STRING in this connection's local memory pool
Expand All @@ -124,7 +124,7 @@ void *thd_memdup(MYSQL_THD thd, const void* str, size_t size);
@see thd_alloc()
*/
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str,
*thd_make_lex_string(const MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, size_t size,
int allocate_lex_string);

Expand Down

0 comments on commit 4e2deb3

Please sign in to comment.