You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Fix warnings
This commit is contained in:
@@ -238,7 +238,7 @@ int pvio_shm_fast_send(MARIADB_PVIO *pvio)
|
|||||||
|
|
||||||
my_bool pvio_shm_connect(MARIADB_PVIO *pvio, MA_PVIO_CINFO *cinfo)
|
my_bool pvio_shm_connect(MARIADB_PVIO *pvio, MA_PVIO_CINFO *cinfo)
|
||||||
{
|
{
|
||||||
char *base_memory_name;
|
const char *base_memory_name;
|
||||||
char *prefixes[]= {"", "Global\\", NULL};
|
char *prefixes[]= {"", "Global\\", NULL};
|
||||||
char *shm_name, *shm_suffix, *shm_prefix;
|
char *shm_name, *shm_suffix, *shm_prefix;
|
||||||
uchar i= 0;
|
uchar i= 0;
|
||||||
@@ -453,16 +453,16 @@ my_bool pvio_shm_is_alive(MARIADB_PVIO *pvio)
|
|||||||
if (!pvio || !pvio->data)
|
if (!pvio || !pvio->data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
pvio_shm= (PVIO_SHM *)pvio->data;
|
pvio_shm= (PVIO_SHM *)pvio->data;
|
||||||
return WaitForSingleObject(pvio_shm->event[PVIO_SHM_CONNECTION_CLOSED], 0);
|
return WaitForSingleObject(pvio_shm->event[PVIO_SHM_CONNECTION_CLOSED], 0)!=WAIT_OBJECT_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
my_bool pvio_shm_get_handle(MARIADB_PVIO *pvio, void *handle)
|
my_bool pvio_shm_get_handle(MARIADB_PVIO *pvio, void *handle)
|
||||||
{
|
{
|
||||||
PVIO_SHM *pvio_shm;
|
|
||||||
*(HANDLE **)handle= 0;
|
*(HANDLE **)handle= 0;
|
||||||
if (!pvio || !pvio->data)
|
if (!pvio || !pvio->data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
*(HANDLE **)handle= (HANDLE **)((PVIO_SHM*)pvio->data)->event;
|
*(HANDLE **)handle= ((PVIO_SHM*)pvio->data)->event;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -26,7 +26,7 @@ char *rand_str(size_t length) {
|
|||||||
char *dest= (char *)malloc(length+1);
|
char *dest= (char *)malloc(length+1);
|
||||||
char *p= dest;
|
char *p= dest;
|
||||||
while (length-- > 0) {
|
while (length-- > 0) {
|
||||||
size_t index = (double) rand() / RAND_MAX * (sizeof charset - 1);
|
size_t index = (size_t)((double)rand() / RAND_MAX * (sizeof charset - 1));
|
||||||
*dest++ = charset[index];
|
*dest++ = charset[index];
|
||||||
}
|
}
|
||||||
*dest = '\0';
|
*dest = '\0';
|
||||||
|
Reference in New Issue
Block a user