8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Finished with warnings cleanup

This commit is contained in:
AlexPeshkoff 2020-12-30 17:16:08 +03:00
parent 4a2ca76e2d
commit 2adaef9aa0
5 changed files with 19 additions and 23 deletions

View File

@ -64,7 +64,7 @@ int main (
* Functional description * Functional description
* *
**************************************/ **************************************/
TEXT cmd [140]; TEXT cmd [256];
if (argc > 1) if (argc > 1)
strcpy (Db_name, argv[1]); strcpy (Db_name, argv[1]);

View File

@ -27,13 +27,17 @@
#define COMMON_SYNC_SIGNALS_H #define COMMON_SYNC_SIGNALS_H
#ifdef UNIX #ifdef UNIX
#ifdef HAVE_SETJMP_H
#include <setjmp.h>
namespace Firebird namespace Firebird
{ {
void syncSignalsSet(void*); void syncSignalsSet(sigjmp_buf*);
void syncSignalsReset(); void syncSignalsReset();
} }
#endif // #ifdef HAVE_SETJMP_H
#endif // UNIX #endif // UNIX
#endif // COMMON_SYNC_SIGNALS_H #endif // COMMON_SYNC_SIGNALS_H

View File

@ -54,10 +54,6 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#if defined FREEBSD || defined NETBSD || defined DARWIN || defined HPUX
#define sigset signal
#endif
namespace { namespace {
// Here we can't use atomic counter instead mutex/counter pair - or some thread may leave SyncSignalsSet() // Here we can't use atomic counter instead mutex/counter pair - or some thread may leave SyncSignalsSet()
@ -76,22 +72,19 @@ namespace {
} // extern "C" } // extern "C"
#ifndef HAVE_SIGSET void fb_sigset(int signum, void (*handler)(int))
typedef void HandlerType(int);
void sigset(int signum, HandlerType* handler)
{ {
struct sigaction act; struct sigaction act;
memset(&act, 0, sizeof act); memset(&act, 0, sizeof act);
act.sa_handler = handler; act.sa_handler = handler;
sigaction(signum, &act, NULL); sigaction(signum, &act, NULL);
} }
#endif
} // anonymous namespace } // anonymous namespace
namespace Firebird { namespace Firebird {
void syncSignalsSet(void* arg) void syncSignalsSet(sigjmp_buf* sigenv)
{ {
/************************************** /**************************************
* *
@ -103,17 +96,16 @@ void syncSignalsSet(void* arg)
* Set all the synchronous signals for a particular thread * Set all the synchronous signals for a particular thread
* *
**************************************/ **************************************/
sigjmp_buf* const sigenv = static_cast<sigjmp_buf*>(arg);
TLS_SET(sigjmpPtr, sigenv); TLS_SET(sigjmpPtr, sigenv);
Firebird::MutexLockGuard g(syncEnterMutex, "syncSignalsSet"); Firebird::MutexLockGuard g(syncEnterMutex, "syncSignalsSet");
if (syncEnterCounter++ == 0) if (syncEnterCounter++ == 0)
{ {
sigset(SIGILL, longjmpSigHandler); fb_sigset(SIGILL, longjmpSigHandler);
sigset(SIGFPE, longjmpSigHandler); fb_sigset(SIGFPE, longjmpSigHandler);
sigset(SIGBUS, longjmpSigHandler); fb_sigset(SIGBUS, longjmpSigHandler);
sigset(SIGSEGV, longjmpSigHandler); fb_sigset(SIGSEGV, longjmpSigHandler);
} }
} }
@ -138,10 +130,10 @@ void syncSignalsReset()
if (--syncEnterCounter == 0) if (--syncEnterCounter == 0)
{ {
sigset(SIGILL, SIG_DFL); fb_sigset(SIGILL, SIG_DFL);
sigset(SIGFPE, SIG_DFL); fb_sigset(SIGFPE, SIG_DFL);
sigset(SIGBUS, SIG_DFL); fb_sigset(SIGBUS, SIG_DFL);
sigset(SIGSEGV, SIG_DFL); fb_sigset(SIGSEGV, SIG_DFL);
} }
} }

View File

@ -770,7 +770,7 @@ processing_state SHOW_grants2 (const SCHAR* object,
prev_user_type = -1; prev_user_type = -1;
prev_object_type = -1; prev_object_type = -1;
char priv_string[MAX_PRIV_LIST] = ""; char priv_string[MAX_PRIV_LIST] = "";
char col_string[BUFFER_LENGTH256] = ""; char col_string[BUFFER_LENGTH512] = "";
char with_option[19] = ""; char with_option[19] = "";
USHORT priv_flags = 0; USHORT priv_flags = 0;
SSHORT prev_field_null = -1; SSHORT prev_field_null = -1;

View File

@ -739,7 +739,7 @@ static void build_other_headers()
int numLines = FB_NELEM(pas_boiler_plate); int numLines = FB_NELEM(pas_boiler_plate);
for (i = 0; i < numLines; i++) { for (i = 0; i < numLines; i++) {
char buffer[256]; char buffer[1400];
strcpy(buffer, pas_boiler_plate[i]); strcpy(buffer, pas_boiler_plate[i]);
char* gds = strstr(buffer, "gds_arg"); char* gds = strstr(buffer, "gds_arg");
if (gds) if (gds)
@ -923,7 +923,7 @@ static void build_other_headers()
static void move_if_not_identical(const char* original, const char* new_file, const char *directory) static void move_if_not_identical(const char* original, const char* new_file, const char *directory)
{ {
char origName[1000]; char origName[1000];
char buffer[1000]; char buffer[1400];
#if defined(WIN_NT) && !defined(__GNUC__) #if defined(WIN_NT) && !defined(__GNUC__)
if ( directory != NULL) { if ( directory != NULL) {
sprintf(origName, "%s\\%s", directory, original); sprintf(origName, "%s\\%s", directory, original);