Changeset: 6e151a1794a1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6e151a1794a1 Modified Files: clients/mapilib/connect_openssl.c clients/mapilib/msettings.c Branch: monetdburl Log Message:
Can't have a declaration right after a switch case: label, apparently diffs (61 lines): diff --git a/clients/mapilib/connect_openssl.c b/clients/mapilib/connect_openssl.c --- a/clients/mapilib/connect_openssl.c +++ b/clients/mapilib/connect_openssl.c @@ -59,13 +59,14 @@ make_ssl_context(Mapi mid, SSL_CTX **ctx // Because we use at least TLSv1.3 we don't need to mess with // SSL_CTX_set_cipher_list() and SSL_CTX_set_ciphersuites(). + const char *cert; switch (msettings_connect_tls_verify(mid->settings)) { case verify_none: case verify_hash: SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL); break; case verify_cert: - const char *cert = msetting_string(mid->settings, MP_CERT); + cert = msetting_string(mid->settings, MP_CERT); if (1 != SSL_CTX_load_verify_file(ctx, cert)) { SSL_CTX_free(ctx); return croak(mid, __func__, "SSL_CTX_load_verify_file: %s", cert); diff --git a/clients/mapilib/msettings.c b/clients/mapilib/msettings.c --- a/clients/mapilib/msettings.c +++ b/clients/mapilib/msettings.c @@ -432,9 +432,10 @@ msetting_set_bool(msettings *mp, mparm p msettings_error msetting_parse(msettings *mp, mparm parm, const char *text) { + int b; // int not bool because we need to allow for parse errors switch (mparm_classify(parm)) { case MPCLASS_BOOL: - int b = msetting_parse_bool(text); + b = msetting_parse_bool(text); if (b < 0) return "invalid boolean value"; return msetting_set_bool(mp, parm, b); @@ -457,12 +458,15 @@ msetting_parse(msettings *mp, mparm parm char * msetting_as_string(msettings *mp, mparm parm) { + bool b; + long l; + const char *s; switch (mparm_classify(parm)) { case MPCLASS_BOOL: - bool b = msetting_bool(mp, parm); + b = msetting_bool(mp, parm); return strdup(b ? "true" : " false"); case MPCLASS_LONG: - long l = msetting_long(mp, parm); + l = msetting_long(mp, parm); int n = 40; char *buf = malloc(n); if (!buf) @@ -470,7 +474,7 @@ msetting_as_string(msettings *mp, mparm snprintf(buf, n, "%ld", l); return buf; case MPCLASS_STRING: - const char *s = msetting_string(mp, parm); + s = msetting_string(mp, parm); return strdup(s); default: assert(0 && "unreachable"); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org