Use explicit types
Use uint64_t instead of unsigned. This guarantees that the size of the type is the same across all platforms.
This commit is contained in:
@ -111,8 +111,8 @@ typedef struct server
|
||||
void *auth_instance; /**< Authenticator instance */
|
||||
char *auth_options; /**< Authenticator options */
|
||||
SSL_LISTENER *server_ssl; /**< SSL data structure for server, if any */
|
||||
unsigned int status; /**< Status flag bitmap for the server */
|
||||
unsigned int status_pending; /**< Pending status flag bitmap for the server */
|
||||
uint64_t status; /**< Status flag bitmap for the server */
|
||||
uint64_t status_pending; /**< Pending status flag bitmap for the server */
|
||||
char monuser[MAX_SERVER_MONUSER_LEN]; /**< User name to use to monitor the db */
|
||||
char monpw[MAX_SERVER_MONPW_LEN]; /**< Password to use to monitor the db */
|
||||
SERVER_STATS stats; /**< The server statistics */
|
||||
@ -334,9 +334,9 @@ extern SERVER *server_find_by_unique_name(const char *name);
|
||||
extern int server_find_by_unique_names(char **server_names, int size, SERVER*** output);
|
||||
extern SERVER *server_find(const char *servname, unsigned short port);
|
||||
extern char *server_status(const SERVER *);
|
||||
extern void server_clear_set_status(SERVER *server, unsigned specified_bits, unsigned bits_to_set);
|
||||
extern void server_set_status_nolock(SERVER *server, unsigned bit);
|
||||
extern void server_clear_status_nolock(SERVER *server, unsigned bit);
|
||||
extern void server_clear_set_status(SERVER *server, uint64_t specified_bits, uint64_t bits_to_set);
|
||||
extern void server_set_status_nolock(SERVER *server, uint64_t bit);
|
||||
extern void server_clear_status_nolock(SERVER *server, uint64_t bit);
|
||||
extern void server_transfer_status(SERVER *dest_server, const SERVER *source_server);
|
||||
extern void server_add_mon_user(SERVER *server, const char *user, const char *passwd);
|
||||
extern const char *server_get_parameter(const SERVER *server, const char *name);
|
||||
@ -344,7 +344,7 @@ extern void server_update_credentials(SERVER *server, const char *user, const ch
|
||||
extern DCB *server_get_persistent(SERVER *server, const char *user, const char *protocol, int id);
|
||||
extern void server_update_address(SERVER *server, const char *address);
|
||||
extern void server_update_port(SERVER *server, unsigned short port);
|
||||
extern unsigned int server_map_status(const char *str);
|
||||
extern uint64_t server_map_status(const char *str);
|
||||
extern void server_set_version_string(SERVER* server, const char* version_string);
|
||||
extern void server_set_version(SERVER* server, const char* version_string, uint64_t version);
|
||||
extern uint64_t server_get_version(const SERVER* server);
|
||||
|
@ -1295,7 +1295,7 @@ dcb_maybe_add_persistent(DCB *dcb)
|
||||
{
|
||||
MXS_DEBUG("Not adding DCB %p to persistent pool, "
|
||||
"user %s, max for pool %ld, error handle called %s, hung flag %s, "
|
||||
"server status %d, pool count %d.",
|
||||
"server status %lu, pool count %d.",
|
||||
dcb, dcb->user ? dcb->user : "",
|
||||
dcb->server->persistpoolmax,
|
||||
dcb->dcb_errhandle_called ? "true" : "false",
|
||||
|
@ -672,7 +672,7 @@ server_status(const SERVER *server)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned int server_status = server->status;
|
||||
uint64_t server_status = server->status;
|
||||
status[0] = 0;
|
||||
if (server_status & SERVER_MAINT)
|
||||
{
|
||||
@ -732,7 +732,7 @@ server_status(const SERVER *server)
|
||||
* @param bit The bit to set for the server
|
||||
*/
|
||||
void
|
||||
server_set_status_nolock(SERVER *server, unsigned bit)
|
||||
server_set_status_nolock(SERVER *server, uint64_t bit)
|
||||
{
|
||||
server->status |= bit;
|
||||
|
||||
@ -753,7 +753,7 @@ server_set_status_nolock(SERVER *server, unsigned bit)
|
||||
* @param bit The bit to set for the server
|
||||
*/
|
||||
void
|
||||
server_clear_set_status(SERVER *server, unsigned specified_bits, unsigned bits_to_set)
|
||||
server_clear_set_status(SERVER *server, uint64_t specified_bits, uint64_t bits_to_set)
|
||||
{
|
||||
/** clear error logged flag before the next failure */
|
||||
if ((bits_to_set & SERVER_MASTER) && ((server->status & SERVER_MASTER) == 0))
|
||||
@ -774,7 +774,7 @@ server_clear_set_status(SERVER *server, unsigned specified_bits, unsigned bits_t
|
||||
* @param bit The bit to clear for the server
|
||||
*/
|
||||
void
|
||||
server_clear_status_nolock(SERVER *server, unsigned bit)
|
||||
server_clear_status_nolock(SERVER *server, uint64_t bit)
|
||||
{
|
||||
server->status &= ~bit;
|
||||
}
|
||||
@ -1052,8 +1052,8 @@ server_update_port(SERVER *server, unsigned short port)
|
||||
|
||||
static struct
|
||||
{
|
||||
const char *str;
|
||||
unsigned int bit;
|
||||
const char* str;
|
||||
uint64_t bit;
|
||||
} ServerBits[] =
|
||||
{
|
||||
{ "running", SERVER_RUNNING },
|
||||
@ -1073,7 +1073,7 @@ static struct
|
||||
* @param str String representation
|
||||
* @return bit value or 0 on error
|
||||
*/
|
||||
unsigned int
|
||||
uint64_t
|
||||
server_map_status(const char *str)
|
||||
{
|
||||
int i;
|
||||
|
Reference in New Issue
Block a user