Fix various compiler warnings.

fish.c: -Wincompatible-pointer-types
fkeys.c: -Wmisleading-indentation
proto-irc.c: -Wincompatible-pointer-types
util.c: -Wdeprecated-declarations
xtext.c: -Wmaybe-uninitialized
This commit is contained in:
Sadie Powell 2022-08-28 17:59:42 +01:00 committed by Patrick
parent 20c50fd7ef
commit 46c9df1863
5 changed files with 9 additions and 4 deletions

View File

@ -91,7 +91,7 @@ static const signed char fish_unbase64[256] = {
#include <openssl/provider.h> #include <openssl/provider.h>
static OSSL_PROVIDER *legacy_provider; static OSSL_PROVIDER *legacy_provider;
static OSSL_PROVIDER *default_provider; static OSSL_PROVIDER *default_provider;
static OSSL_LIB_CTX* *ossl_ctx; static OSSL_LIB_CTX *ossl_ctx;
#endif #endif
int fish_init(void) int fish_init(void)

View File

@ -461,7 +461,7 @@ channel_date (session *sess, char *chan, char *timestr,
} }
static int static int
trailing_index(const char *word_eol[]) trailing_index(char *word_eol[])
{ {
int param_index; int param_index;
for (param_index = 3; param_index < PDIWORDS; ++param_index) for (param_index = 3; param_index < PDIWORDS; ++param_index)

View File

@ -1375,11 +1375,16 @@ str_sha256hash (char *string)
int i; int i;
unsigned char hash[SHA256_DIGEST_LENGTH]; unsigned char hash[SHA256_DIGEST_LENGTH];
char buf[SHA256_DIGEST_LENGTH * 2 + 1]; /* 64 digit hash + '\0' */ char buf[SHA256_DIGEST_LENGTH * 2 + 1]; /* 64 digit hash + '\0' */
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
SHA256 (string, strlen (string), hash);
#else
SHA256_CTX sha256; SHA256_CTX sha256;
SHA256_Init (&sha256); SHA256_Init (&sha256);
SHA256_Update (&sha256, string, strlen (string)); SHA256_Update (&sha256, string, strlen (string));
SHA256_Final (hash, &sha256); SHA256_Final (hash, &sha256);
#endif
for (i = 0; i < SHA256_DIGEST_LENGTH; i++) for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
{ {

View File

@ -894,7 +894,7 @@ key_save_kbs (void)
#define STRIP_WHITESPACE \ #define STRIP_WHITESPACE \
while (buf[0] == ' ' || buf[0] == '\t') \ while (buf[0] == ' ' || buf[0] == '\t') \
buf++; \ buf++; \
len = strlen (buf); \ len = strlen (buf); \
while (buf[len] == ' ' || buf[len] == '\t') \ while (buf[len] == ' ' || buf[len] == '\t') \
{ \ { \
buf[len] = 0; \ buf[len] = 0; \

View File

@ -947,7 +947,7 @@ gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off, int *out_of_bound
textentry *ent; textentry *ent;
int line; int line;
int subline; int subline;
int outofbounds; int outofbounds = FALSE;
/* Adjust y value for negative rounding, double to int */ /* Adjust y value for negative rounding, double to int */
if (y < 0) if (y < 0)