From dd167b4c8393677f465c03d66b438d519c43fb87 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 15 Apr 2022 13:43:22 -0500 Subject: python: Fix API break in hook_timer() Closes #2691 --- plugins/python/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/python/python.py b/plugins/python/python.py index 1adcde98..0420a4e2 100644 --- a/plugins/python/python.py +++ b/plugins/python/python.py @@ -284,7 +284,7 @@ def _on_server_attrs_hook(word, word_eol, attrs, userdata): @ffi.def_extern() def _on_timer_hook(userdata): hook = ffi.from_handle(userdata) - if hook.callback(hook.userdata) is True: + if hook.callback(hook.userdata) == True: return 1 hook.is_unload = True # Don't unhook -- cgit 1.4.1 From 6da8f97e37f1eb57c1dcb9fc094f386385dae22b Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 7 May 2022 19:16:11 +0300 Subject: fix addons load in python2 --- plugins/python/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/python/python.py b/plugins/python/python.py index 0420a4e2..7a794784 100644 --- a/plugins/python/python.py +++ b/plugins/python/python.py @@ -146,8 +146,8 @@ class Plugin: def loadfile(self, filename): try: self.filename = filename - with open(filename, encoding='utf-8') as f: - data = f.read() + with open(filename, 'rb') as f: + data = f.read().decode('utf-8') compiled = compile_file(data, filename) exec(compiled, self.globals) -- cgit 1.4.1 From 46c9df18639ff0ee343d4c8ad48e845795b6ac1c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 28 Aug 2022 17:59:42 +0100 Subject: 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 --- plugins/fishlim/fish.c | 2 +- src/common/proto-irc.c | 2 +- src/common/util.c | 5 +++++ src/fe-gtk/fkeys.c | 2 +- src/fe-gtk/xtext.c | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/fishlim/fish.c b/plugins/fishlim/fish.c index 5a27e4cb..7fe7e287 100644 --- a/plugins/fishlim/fish.c +++ b/plugins/fishlim/fish.c @@ -91,7 +91,7 @@ static const signed char fish_unbase64[256] = { #include static OSSL_PROVIDER *legacy_provider; static OSSL_PROVIDER *default_provider; -static OSSL_LIB_CTX* *ossl_ctx; +static OSSL_LIB_CTX *ossl_ctx; #endif int fish_init(void) diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 32cc47f2..5b8e02c4 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -461,7 +461,7 @@ channel_date (session *sess, char *chan, char *timestr, } static int -trailing_index(const char *word_eol[]) +trailing_index(char *word_eol[]) { int param_index; for (param_index = 3; param_index < PDIWORDS; ++param_index) diff --git a/src/common/util.c b/src/common/util.c index fa0783d4..f06074fc 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1375,11 +1375,16 @@ str_sha256hash (char *string) int i; unsigned char hash[SHA256_DIGEST_LENGTH]; 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_Init (&sha256); SHA256_Update (&sha256, string, strlen (string)); SHA256_Final (hash, &sha256); +#endif for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { diff --git a/src/fe-gtk/fkeys.c b/src/fe-gtk/fkeys.c index dc4b41bc..6dd16e35 100644 --- a/src/fe-gtk/fkeys.c +++ b/src/fe-gtk/fkeys.c @@ -894,7 +894,7 @@ key_save_kbs (void) #define STRIP_WHITESPACE \ while (buf[0] == ' ' || buf[0] == '\t') \ buf++; \ - len = strlen (buf); \ + len = strlen (buf); \ while (buf[len] == ' ' || buf[len] == '\t') \ { \ buf[len] = 0; \ diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 6a0fccba..08a5110a 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -947,7 +947,7 @@ gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off, int *out_of_bound textentry *ent; int line; int subline; - int outofbounds; + int outofbounds = FALSE; /* Adjust y value for negative rounding, double to int */ if (y < 0) -- cgit 1.4.1