1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

core: fix style

This commit is contained in:
Sébastien Helleu
2023-12-14 23:11:35 +01:00
parent ffa933bcf8
commit fa0b320178
16 changed files with 54 additions and 49 deletions
+1 -1
View File
@@ -7117,7 +7117,7 @@ COMMAND_CALLBACK(upgrade)
(void) hook_signal_send ("upgrade", WEECHAT_HOOK_SIGNAL_STRING,
"save");
/* save WeeChat session */
if (!upgrade_weechat_save())
if (!upgrade_weechat_save ())
{
gui_chat_printf (NULL,
_("%sUnable to save WeeChat session "
+10 -10
View File
@@ -208,9 +208,9 @@ doc_gen_check_command (const char *plugin, const char *command)
return 1;
/* document other options only for weechat, irc, xfer */
return((strcmp (plugin, "weechat") == 0)
|| (strcmp (plugin, "irc") == 0)
|| (strcmp (plugin, "xfer") == 0)) ?
return ((strcmp (plugin, "weechat") == 0)
|| (strcmp (plugin, "irc") == 0)
|| (strcmp (plugin, "xfer") == 0)) ?
1 : 0;
}
@@ -644,11 +644,11 @@ doc_gen_user_default_aliases (const char *path, const char *lang)
ptr_infolist = hook_infolist_get (NULL, "alias_default", NULL, NULL);
while (infolist_next (ptr_infolist))
{
ptr_completion = infolist_string(ptr_infolist, "completion");
ptr_completion = infolist_string (ptr_infolist, "completion");
string_fprintf (file,
"| /%s | /%s | %s\n",
ESCAPE_TABLE(infolist_string(ptr_infolist, "name")),
ESCAPE_TABLE(infolist_string(ptr_infolist, "command")),
ESCAPE_TABLE(infolist_string (ptr_infolist, "name")),
ESCAPE_TABLE(infolist_string (ptr_infolist, "command")),
(ptr_completion && ptr_completion[0]) ?
ESCAPE_TABLE(ptr_completion) : "-");
}
@@ -695,8 +695,8 @@ doc_gen_user_irc_colors (const char *path, const char *lang)
string_fprintf (
file,
"| %s | %s\n",
ESCAPE_TABLE(infolist_string(ptr_infolist, "color_irc")),
ESCAPE_TABLE(infolist_string(ptr_infolist, "color_weechat")));
ESCAPE_TABLE(infolist_string (ptr_infolist, "color_irc")),
ESCAPE_TABLE(infolist_string (ptr_infolist, "color_weechat")));
}
infolist_free (ptr_infolist);
@@ -1156,11 +1156,11 @@ doc_gen_api_hdata_content (FILE *file, struct t_hdata *hdata)
}
hashtable_remove_all (hashtable);
hashtable_set (hashtable, "__create_allowed", "");
if (hdata_update(hdata, NULL, hashtable))
if (hdata_update (hdata, NULL, hashtable))
arraylist_add (list_vars_update, "{hdata_update_create}");
hashtable_remove_all (hashtable);
hashtable_set (hashtable, "__delete_allowed", "");
if (hdata_update(hdata, NULL, hashtable))
if (hdata_update (hdata, NULL, hashtable))
arraylist_add (list_vars_update, "{hdata_update_delete}");
list_size = arraylist_size (list_vars_update);
if (list_size > 0)
+20 -15
View File
@@ -607,14 +607,16 @@ gui_chat_display_word (struct t_gui_window *window,
ptr_data = data;
while (ptr_data && ptr_data[0])
{
chars_displayed += gui_chat_display_prefix_suffix(window, line,
word + (ptr_data - data),
pre_lines_displayed,
lines_displayed,
chars_displayed,
simulate,
apply_style_inactive,
nick_offline);
chars_displayed += gui_chat_display_prefix_suffix (
window,
line,
word + (ptr_data - data),
pre_lines_displayed,
lines_displayed,
chars_displayed,
simulate,
apply_style_inactive,
nick_offline);
chars_to_display = gui_chat_strlen_screen (ptr_data);
@@ -1528,13 +1530,16 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
gui_chat_display_new_line (window, num_lines, count,
&lines_displayed, simulate);
ptr_data++;
gui_chat_display_prefix_suffix(window, line,
ptr_data,
pre_lines_displayed, &lines_displayed,
0,
simulate,
CONFIG_BOOLEAN(config_look_color_inactive_message),
0);
gui_chat_display_prefix_suffix (
window,
line,
ptr_data,
pre_lines_displayed,
&lines_displayed,
0,
simulate,
CONFIG_BOOLEAN(config_look_color_inactive_message),
0);
}
gui_chat_get_word_info (window,
+1 -1
View File
@@ -46,7 +46,7 @@
#include "gui-curses.h"
#define BIND(key, command) \
gui_key_default_bind(context, key, command, create_option)
gui_key_default_bind (context, key, command, create_option)
/*
+2 -2
View File
@@ -50,7 +50,7 @@ daemonize ()
printf (_("Running WeeChat in background..."));
printf (" ");
pid = fork();
pid = fork ();
if (pid < 0)
{
@@ -73,7 +73,7 @@ daemonize ()
setsid ();
/* close all file descriptors */
for (i = sysconf(_SC_OPEN_MAX); i >= 0; --i)
for (i = sysconf (_SC_OPEN_MAX); i >= 0; --i)
{
close (i);
}
+1 -1
View File
@@ -1351,7 +1351,7 @@ gui_completion_command (struct t_gui_completion *completion)
*/
char *
gui_completion_get_default_template(struct t_gui_completion *completion)
gui_completion_get_default_template (struct t_gui_completion *completion)
{
const char *ptr_default_template;
char *value;
+1 -1
View File
@@ -261,7 +261,7 @@ fifo_exec (const char *text)
free (text2);
if (command_unescaped)
free(command_unescaped);
free (command_unescaped);
}
/*
+3 -3
View File
@@ -60,8 +60,8 @@
GUILE_CURRENT_SCRIPT_NAME, \
guile_function_name, __string)
#define API_SCM_TO_STRING(__str) \
weechat_guile_api_scm_to_string(__str, \
guile_strings, &guile_num_strings)
weechat_guile_api_scm_to_string (__str, \
guile_strings, &guile_num_strings)
#define API_FREE_STRINGS \
if (guile_num_strings > 0) \
{ \
@@ -76,7 +76,7 @@
return scm_from_int (0)
#define API_RETURN_EMPTY \
API_FREE_STRINGS; \
return scm_from_locale_string("")
return scm_from_locale_string ("")
#define API_RETURN_STRING(__string) \
return_value = scm_from_locale_string ((__string) ? __string : ""); \
API_FREE_STRINGS; \
+1 -1
View File
@@ -80,7 +80,7 @@ irc_batch_generate_random_ref (char *string, int size)
length_chars = strlen (chars);
for (i = 0; i < size; i++)
{
string[i] = chars[rand() % length_chars];
string[i] = chars[rand () % length_chars];
}
string[size] = '\0';
}
+1 -1
View File
@@ -4075,7 +4075,7 @@ IRC_PROTOCOL_CALLBACK(001)
}
else
{
length = 1 + strlen(command3) + 1;
length = 1 + strlen (command3) + 1;
slash_command = malloc (length);
if (slash_command)
{
+4 -4
View File
@@ -366,16 +366,16 @@ weechat_perl_exec (struct t_plugin_script *script,
{
case 's': /* string or null */
if (argv[i])
XPUSHs (sv_2mortal(newSVpv((char *)argv[i], 0)));
XPUSHs (sv_2mortal (newSVpv((char *)argv[i], 0)));
else
XPUSHs (sv_2mortal(&PL_sv_undef));
XPUSHs (sv_2mortal (&PL_sv_undef));
break;
case 'i': /* integer */
XPUSHs (sv_2mortal(newSViv(*((int *)argv[i]))));
XPUSHs (sv_2mortal (newSViv (*((int *)argv[i]))));
break;
case 'h': /* hash */
hash = weechat_perl_hashtable_to_hash (argv[i]);
XPUSHs (sv_2mortal(newRV_inc((SV *)hash)));
XPUSHs (sv_2mortal (newRV_inc ((SV *)hash)));
break;
}
}
+1 -1
View File
@@ -708,7 +708,7 @@ weechat_php_load (const char *filename, const char *code)
memset (&file_handle, 0, sizeof (file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
#if PHP_VERSION_ID >= 80100
file_handle.filename = zend_string_init(filename, strlen(filename), 0);
file_handle.filename = zend_string_init (filename, strlen(filename), 0);
#else
file_handle.filename = filename;
#endif
+4 -4
View File
@@ -59,7 +59,7 @@
plugin_script_str2ptr (weechat_python_plugin, \
PYTHON_CURRENT_SCRIPT_NAME, \
python_function_name, __string)
#define API_RETURN_OK return PyLong_FromLong((long)1)
#define API_RETURN_OK return PyLong_FromLong ((long)1)
#define API_RETURN_ERROR return PyLong_FromLong ((long)0)
#define API_RETURN_EMPTY \
Py_INCREF (Py_None); \
@@ -77,11 +77,11 @@
} \
return Py_BuildValue ("s", "")
#define API_RETURN_INT(__int) \
return PyLong_FromLong((long)__int)
return PyLong_FromLong ((long)__int)
#define API_RETURN_LONG(__long) \
return PyLong_FromLong(__long)
return PyLong_FromLong (__long)
#define API_RETURN_LONGLONG(__longlong) \
return PyLong_FromLongLong(__longlong)
return PyLong_FromLongLong (__longlong)
/*
+2 -2
View File
@@ -1504,9 +1504,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* PyEval_InitThreads(); */
/* python_mainThreadState = PyThreadState_Swap(NULL); */
#if PY_VERSION_HEX >= 0x03070000
python_mainThreadState = PyThreadState_Get();
python_mainThreadState = PyThreadState_Get ();
#else
python_mainThreadState = PyEval_SaveThread();
python_mainThreadState = PyEval_SaveThread ();
#endif
/* PyEval_ReleaseLock (); */
@@ -1135,7 +1135,7 @@ relay_weechat_msg_compress_zstd (struct t_relay_client *client,
compression_level = (((compression - 1) * 19) / 100) + 1;
gettimeofday (&tv1, NULL);
comp_size = ZSTD_compress(
comp_size = ZSTD_compress (
dest + 5,
dest_size,
(void *)(msg->data + 5),
+1 -1
View File
@@ -274,7 +274,7 @@ weechat_ruby_print_exception (VALUE err)
backtrace = rb_protect_funcall (err, rb_intern ("backtrace"),
&ruby_error, 0, NULL);
message = rb_protect_funcall(err, rb_intern ("message"), &ruby_error, 0, NULL);
message = rb_protect_funcall (err, rb_intern ("message"), &ruby_error, 0, NULL);
err_msg = StringValueCStr (message);
err_class = NULL;