Skip to content

Commit

Permalink
easy to clean warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
FauxFaux committed Aug 11, 2013
1 parent 704489f commit 78f40b5
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
1 change: 0 additions & 1 deletion adb.c
Expand Up @@ -136,7 +136,6 @@ static const char *adb_init(void *frontend_handle, void **backend_handle,
SockAddr addr;
const char *err;
Adb adb;
char sendhost[512];

adb = snew(struct adb_backend_data);
adb->fn = &fn_table;
Expand Down
2 changes: 1 addition & 1 deletion pinger.c
Expand Up @@ -28,7 +28,7 @@ static void pinger_timer(void *ctx, unsigned long now)

static void pinger_schedule(Pinger pinger)
{
int next;
unsigned long next;

if (!pinger->interval) {
pinger->pending = FALSE; /* cancel any pending ping */
Expand Down
24 changes: 12 additions & 12 deletions proxy.c
Expand Up @@ -336,27 +336,27 @@ static int proxy_for_destination (SockAddr addr, const char *hostname,
if (exclude_list[s] == '*') {
/* wildcard at beginning of entry */

if ((addr && strnicmp(hostip + hostip_len - (e - s - 1),
if ((addr && _strnicmp(hostip + hostip_len - (e - s - 1),
exclude_list + s + 1, e - s - 1) == 0) ||
strnicmp(hostname + hostname_len - (e - s - 1),
_strnicmp(hostname + hostname_len - (e - s - 1),
exclude_list + s + 1, e - s - 1) == 0)
return 0; /* IP/hostname range excluded. do not use proxy. */

} else if (exclude_list[e-1] == '*') {
/* wildcard at end of entry */

if ((addr && strnicmp(hostip, exclude_list + s, e - s - 1) == 0) ||
strnicmp(hostname, exclude_list + s, e - s - 1) == 0)
if ((addr && _strnicmp(hostip, exclude_list + s, e - s - 1) == 0) ||
_strnicmp(hostname, exclude_list + s, e - s - 1) == 0)
return 0; /* IP/hostname range excluded. do not use proxy. */

} else {
/* no wildcard at either end, so let's try an absolute
* match (ie. a specific IP)
*/

if (addr && strnicmp(hostip, exclude_list + s, e - s) == 0)
if (addr && _strnicmp(hostip, exclude_list + s, e - s) == 0)
return 0; /* IP/hostname excluded. do not use proxy. */
if (strnicmp(hostname, exclude_list + s, e - s) == 0)
if (_strnicmp(hostname, exclude_list + s, e - s) == 0)
return 0; /* IP/hostname excluded. do not use proxy. */
}

Expand Down Expand Up @@ -1373,7 +1373,7 @@ char *format_telnet_command(SockAddr addr, int port, Conf *conf)
ret[retlen++] = '%';
eo++;
}
else if (strnicmp(fmt + eo, "host", 4) == 0) {
else if (_strnicmp(fmt + eo, "host", 4) == 0) {
char dest[512];
int destlen;
sk_getaddr(addr, dest, lenof(dest));
Expand All @@ -1383,39 +1383,39 @@ char *format_telnet_command(SockAddr addr, int port, Conf *conf)
retlen += destlen;
eo += 4;
}
else if (strnicmp(fmt + eo, "port", 4) == 0) {
else if (_strnicmp(fmt + eo, "port", 4) == 0) {
char portstr[8], portlen;
portlen = sprintf(portstr, "%i", port);
ENSURE(portlen);
memcpy(ret + retlen, portstr, portlen);
retlen += portlen;
eo += 4;
}
else if (strnicmp(fmt + eo, "user", 4) == 0) {
else if (_strnicmp(fmt + eo, "user", 4) == 0) {
char *username = conf_get_str(conf, CONF_proxy_username);
int userlen = strlen(username);
ENSURE(userlen);
memcpy(ret+retlen, username, userlen);
retlen += userlen;
eo += 4;
}
else if (strnicmp(fmt + eo, "pass", 4) == 0) {
else if (_strnicmp(fmt + eo, "pass", 4) == 0) {
char *password = conf_get_str(conf, CONF_proxy_password);
int passlen = strlen(password);
ENSURE(passlen);
memcpy(ret+retlen, password, passlen);
retlen += passlen;
eo += 4;
}
else if (strnicmp(fmt + eo, "proxyhost", 9) == 0) {
else if (_strnicmp(fmt + eo, "proxyhost", 9) == 0) {
char *host = conf_get_str(conf, CONF_proxy_host);
int phlen = strlen(host);
ENSURE(phlen);
memcpy(ret+retlen, host, phlen);
retlen += phlen;
eo += 9;
}
else if (strnicmp(fmt + eo, "proxyport", 9) == 0) {
else if (_strnicmp(fmt + eo, "proxyport", 9) == 0) {
int port = conf_get_int(conf, CONF_proxy_port);
char pport[50];
int pplen;
Expand Down
1 change: 1 addition & 0 deletions putty.h
Expand Up @@ -1352,6 +1352,7 @@ int filename_serialise(const Filename *f, void *data);
Filename *filename_deserialise(void *data, int maxsize, int *used);
char *get_username(void); /* return value needs freeing */
char *get_random_data(int bytes); /* used in cmdgen.c */
HICON extract_icon(char *iconpath, int smallicon);

/*
* Exports and imports from timing.c.
Expand Down
4 changes: 2 additions & 2 deletions settings.c
Expand Up @@ -531,9 +531,9 @@ void save_open_settings(void *sesskey, Conf *conf)
write_setting_i(sesskey, "HyperlinkUnderline", conf_get_int(conf, CONF_url_underline));
write_setting_i(sesskey, "HyperlinkUseCtrlClick", conf_get_int(conf, CONF_url_ctrl_click));
write_setting_i(sesskey, "HyperlinkBrowserUseDefault", conf_get_int(conf, CONF_url_defbrowser));
write_setting_filename(sesskey, "HyperlinkBrowser", conf_get_int(conf, CONF_url_browser));
write_setting_filename(sesskey, "HyperlinkBrowser", conf_get_filename(conf, CONF_url_browser));
write_setting_i(sesskey, "HyperlinkRegularExpressionUseDefault", conf_get_int(conf, CONF_url_defregex));
write_setting_s(sesskey, "HyperlinkRegularExpression", conf_get_int(conf, CONF_url_regex));
write_setting_s(sesskey, "HyperlinkRegularExpression", conf_get_str(conf, CONF_url_regex));
write_setting_i(sesskey, "AltF4", conf_get_int(conf, CONF_alt_f4));
write_setting_i(sesskey, "AltSpace", conf_get_int(conf, CONF_alt_space));
write_setting_i(sesskey, "AltOnly", conf_get_int(conf, CONF_alt_only));
Expand Down
18 changes: 9 additions & 9 deletions ssh.c
Expand Up @@ -288,15 +288,15 @@ static unsigned int ssh_tty_parse_specchar(char *s)
}
static unsigned int ssh_tty_parse_boolean(char *s)
{
if (stricmp(s, "yes") == 0 ||
stricmp(s, "on") == 0 ||
stricmp(s, "true") == 0 ||
stricmp(s, "+") == 0)
if (_stricmp(s, "yes") == 0 ||
_stricmp(s, "on") == 0 ||
_stricmp(s, "true") == 0 ||
_stricmp(s, "+") == 0)
return 1; /* true */
else if (stricmp(s, "no") == 0 ||
stricmp(s, "off") == 0 ||
stricmp(s, "false") == 0 ||
stricmp(s, "-") == 0)
else if (_stricmp(s, "no") == 0 ||
_stricmp(s, "off") == 0 ||
_stricmp(s, "false") == 0 ||
_stricmp(s, "-") == 0)
return 0; /* false */
else
return (atoi(s) != 0);
Expand Down Expand Up @@ -9861,7 +9861,7 @@ static void ssh_reconfig(void *handle, Conf *conf)
unsigned long new_next = ssh->last_rekey + rekey_time*60*TICKSPERSEC;
unsigned long now = GETTICKCOUNT();

if (now - ssh->last_rekey > rekey_time*60*TICKSPERSEC) {
if (now - ssh->last_rekey > rekey_time*60ul*TICKSPERSEC) {
rekeying = "timeout shortened";
} else {
ssh->next_rekey = schedule_timer(new_next - now, ssh2_timer, ssh);
Expand Down
4 changes: 2 additions & 2 deletions urlhack.c
Expand Up @@ -13,7 +13,7 @@ static unsigned int link_regions_current_pos;

void urlhack_launch_url(const char* app, const char *url);
int urlhack_is_ctrl_pressed();
void rtfm(char *error);
void rtfm(const char *error);

int urlhack_is_in_link_region(int x, int y)
{
Expand Down Expand Up @@ -61,7 +61,7 @@ text_region urlhack_get_link_bounds(int x, int y)
return region;
}

text_region urlhack_get_link_region(int index)
text_region urlhack_get_link_region(unsigned int index)
{
text_region region;

Expand Down
2 changes: 1 addition & 1 deletion windows/re_lib/regexp.h
Expand Up @@ -18,5 +18,5 @@ typedef struct regexp {
regexp *regcomp( char* re);
int regexec( regexp* r, char* str);
void regsub( regexp* r, char* str, char* substr);
void regerror( char* s); /* for internal use only */
void regerror( const char* s); /* for internal use only */
void set_regerror_func( void (*func)( const char*));
2 changes: 1 addition & 1 deletion windows/urlhack.h
Expand Up @@ -12,7 +12,7 @@ extern int urlhack_mouse_old_x, urlhack_mouse_old_y, urlhack_current_region;
void urlhack_reset();
void urlhack_go_find_me_some_hyperlinks(int screen_width);
void urlhack_putchar(char ch);
text_region urlhack_get_link_region(int index);
text_region urlhack_get_link_region(unsigned int index);

int urlhack_is_in_link_region(int x, int y);
int urlhack_is_in_this_link_region(text_region r, int x, int y);
Expand Down
2 changes: 0 additions & 2 deletions windows/windlg.c
Expand Up @@ -190,8 +190,6 @@ static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
static int CALLBACK AboutProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
char *str;

switch (msg) {
case WM_INITDIALOG:
SetDlgItemText(hwnd, IDA_VERSION, ver);
Expand Down
2 changes: 1 addition & 1 deletion windows/window.c
Expand Up @@ -5472,7 +5472,7 @@ void write_clip(void *frontend, wchar_t * data, int *attr, int len, int must_des

/* url-cut */
if (conf_get_int(conf, CONF_copy_clipbd_url_reg))
urldata = strdup((char*)lock2);
urldata = _strdup((char*)lock2);
else
urldata = 0;

Expand Down
2 changes: 2 additions & 0 deletions windows/winnet.c
Expand Up @@ -909,7 +909,9 @@ static DWORD try_connect(Actual_Socket sock)
char *errstr;
short localport;
int family;
#if defined(IPTOS) && defined(WINSOCK_TWO)
int tos;
#endif

if (sock->s != INVALID_SOCKET) {
do_select(sock->s, 0);
Expand Down

0 comments on commit 78f40b5

Please sign in to comment.