Change various types to the correct signedness to avoid warnings.

Also cast the check of "inet_addr" to guint32. The POSIX declaration
of this function returns in_addr_t which is the same as uint32_t.
Windows does not define this type and instead uses unsigned long.
This commit is contained in:
Collin Funk 2024-01-28 19:33:45 -08:00 committed by Patrick
parent 0c48785543
commit 180ce9f4fd
8 changed files with 10 additions and 8 deletions

View File

@ -145,7 +145,8 @@ void fish_deinit(void)
*/
char *fish_base64_encode(const char *message, size_t message_len) {
BF_LONG left = 0, right = 0;
int i, j;
int i;
size_t j;
char *encoded = NULL;
char *end = NULL;
char *msg = NULL;

View File

@ -36,7 +36,7 @@ static void
random_string(char *out, size_t len)
{
GRand *rand = NULL;
int i = 0;
size_t i = 0;
rand = g_rand_new();
for (i = 0; i < len; ++i) {

View File

@ -67,7 +67,7 @@ hexchat_remote (void)
gboolean hexchat_running;
GError *error = NULL;
char *command = NULL;
int i;
guint i;
/* if there is nothing to do, return now. */
if (!arg_existing || !(arg_url || arg_urls || arg_command)) {

View File

@ -680,7 +680,7 @@ handle_mode (server * serv, char *word[], char *word_eol[],
int len;
size_t arg;
size_t i, num_args;
int num_modes;
size_t num_modes;
size_t offset = 3;
int all_modes_have_args = FALSE;
int using_front_tab = FALSE;

View File

@ -468,7 +468,7 @@ create_mask (session * sess, char *mask, char *mode, char *typestr, int deop)
type = prefs.hex_irc_ban_type;
buf[0] = 0;
if (inet_addr (fullhost) != -1) /* "fullhost" is really a IP number */
if (inet_addr (fullhost) != (guint32) -1) /* "fullhost" is really a IP number */
{
lastdot = strrchr (fullhost, '.');
if (!lastdot)

View File

@ -331,7 +331,7 @@ url_check_line (char *buf)
GRegex *re(void);
GMatchInfo *gmi;
char *po = buf;
int i;
size_t i;
/* Skip over message prefix */
if (*po == ':')

View File

@ -988,7 +988,7 @@ void
country_search (char *pattern, void *ud, void (*print)(void *, char *, ...))
{
const domain_t *dom;
int i;
size_t i;
for (i = 0; i < sizeof (domain) / sizeof (domain_t); i++)
{

View File

@ -170,7 +170,8 @@ xtext_pango_attr (PangoAttribute *attr)
static void
xtext_pango_init (GtkXText *xtext)
{
int i, j;
size_t i;
int j;
char buf[2] = "\000";
if (attr_lists[0])