From 7dc3df386f9b0fadc115ff55eefb8fbeb1c3077a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 5 Jan 2013 15:07:22 +0000 Subject: - fix for Unicode popups; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@2980 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/libyahoo2/libyahoo2.c | 6 +++--- protocols/Yahoo/src/libyahoo2/yahoo_debug.h | 18 +++++++++--------- protocols/Yahoo/src/libyahoo2/yahoo_httplib.c | 26 +++++++++++++------------- protocols/Yahoo/src/libyahoo2/yahoo_list.c | 2 +- protocols/Yahoo/src/libyahoo2/yahoo_util.c | 14 +++++++------- protocols/Yahoo/src/libyahoo2/yahoo_util.h | 4 ++-- 6 files changed, 35 insertions(+), 35 deletions(-) (limited to 'protocols/Yahoo/src/libyahoo2') diff --git a/protocols/Yahoo/src/libyahoo2/libyahoo2.c b/protocols/Yahoo/src/libyahoo2/libyahoo2.c index f51475a5ca..3da50e7b67 100644 --- a/protocols/Yahoo/src/libyahoo2/libyahoo2.c +++ b/protocols/Yahoo/src/libyahoo2/libyahoo2.c @@ -1995,7 +1995,7 @@ static void yahoo_process_logon(struct yahoo_input_data *yid, struct yahoo_packe case 60: /* SMS -> 1 MOBILE USER */ /* sometimes going offline makes this 2, but invisible never sends it */ //NOTICE(("key %d:%s", pair->key, pair->value)); - if (atoi(pair->value) > 0 ) + if (atoi(pair->value) > 0) mobile = 1; break; @@ -2132,7 +2132,7 @@ static void yahoo_process_status(struct yahoo_input_data *yid, struct yahoo_pack case 60: /* SMS -> 1 MOBILE USER */ /* sometimes going offline makes this 2, but invisible never sends it */ NOTICE(("key %d:%s", pair->key, pair->value)); - if (atoi(pair->value) > 0 ) + if (atoi(pair->value) > 0) mobile = 1; break; case 16: /* Custom error message */ @@ -2421,7 +2421,7 @@ GET /config/pwtoken_login?src=ymsgr&ts=1195577376&token=token HTTP/1.1 **/ yss = yd->server_settings; - if (yd->pw_token == NULL ) { + if (yd->pw_token == NULL) { c = yahoo_urlencode(yd->password); diff --git a/protocols/Yahoo/src/libyahoo2/yahoo_debug.h b/protocols/Yahoo/src/libyahoo2/yahoo_debug.h index b9d048b53d..9a847c9051 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo_debug.h +++ b/protocols/Yahoo/src/libyahoo2/yahoo_debug.h @@ -26,33 +26,33 @@ #endif /* -#define NOTICE(x) if(yahoo_get_log_level() >= YAHOO_LOG_NOTICE) { yahoo_log_message x; yahoo_log_message("\n"); } +#define NOTICE(x) if (yahoo_get_log_level() >= YAHOO_LOG_NOTICE) { yahoo_log_message x; yahoo_log_message("\n"); } -#define LOG(x) if(yahoo_get_log_level() >= YAHOO_LOG_INFO) { yahoo_log_message("%s:%d: ", __FILE__, __LINE__); \ +#define LOG(x) if (yahoo_get_log_level() >= YAHOO_LOG_INFO) { yahoo_log_message("%s:%d: ", __FILE__, __LINE__); \ yahoo_log_message x; \ yahoo_log_message("\n"); } -#define WARNING(x) if(yahoo_get_log_level() >= YAHOO_LOG_WARNING) { yahoo_log_message("%s:%d: warning: ", __FILE__, __LINE__); \ +#define WARNING(x) if (yahoo_get_log_level() >= YAHOO_LOG_WARNING) { yahoo_log_message("%s:%d: warning: ", __FILE__, __LINE__); \ yahoo_log_message x; \ yahoo_log_message("\n"); } -#define DEBUG_MSG(x) if(yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { yahoo_log_message("%s:%d: debug: ", __FILE__, __LINE__); \ +#define DEBUG_MSG(x) if (yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { yahoo_log_message("%s:%d: debug: ", __FILE__, __LINE__); \ yahoo_log_message x; \ yahoo_log_message("\n"); } */ -#define NOTICE(x) if(yahoo_get_log_level() >= YAHOO_LOG_NOTICE) { yahoo_log_message x; yahoo_log_message(" "); } +#define NOTICE(x) if (yahoo_get_log_level() >= YAHOO_LOG_NOTICE) { yahoo_log_message x; yahoo_log_message(" "); } -#define LOG(x) if(yahoo_get_log_level() >= YAHOO_LOG_INFO) { yahoo_log_message("%s:%d: ", __FILE__, __LINE__); \ +#define LOG(x) if (yahoo_get_log_level() >= YAHOO_LOG_INFO) { yahoo_log_message("%s:%d: ", __FILE__, __LINE__); \ yahoo_log_message x; \ yahoo_log_message(" "); } -#define WARNING(x) if(yahoo_get_log_level() >= YAHOO_LOG_WARNING) { yahoo_log_message("%s:%d: warning: ", __FILE__, __LINE__); \ +#define WARNING(x) if (yahoo_get_log_level() >= YAHOO_LOG_WARNING) { yahoo_log_message("%s:%d: warning: ", __FILE__, __LINE__); \ yahoo_log_message x; \ yahoo_log_message(" "); } -#define DEBUG_MSG(x) if(yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { yahoo_log_message("%s:%d: debug: ", __FILE__, __LINE__); \ +#define DEBUG_MSG(x) if (yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { yahoo_log_message("%s:%d: debug: ", __FILE__, __LINE__); \ yahoo_log_message x; \ yahoo_log_message(" "); } -#define DEBUG_MSG1(x) if(yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { \ +#define DEBUG_MSG1(x) if (yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { \ yahoo_log_message x; } diff --git a/protocols/Yahoo/src/libyahoo2/yahoo_httplib.c b/protocols/Yahoo/src/libyahoo2/yahoo_httplib.c index 7305157d83..c3543917f1 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo_httplib.c +++ b/protocols/Yahoo/src/libyahoo2/yahoo_httplib.c @@ -79,7 +79,7 @@ int yahoo_tcp_readline(char *ptr, int maxlen, int fd) } while(rc == -1 && (errno == EINTR || errno == EAGAIN)); /* this is bad - it should be done asynchronously */ if (rc == 1) { - if(c == '\r') /* get rid of \r */ + if (c == '\r') /* get rid of \r */ continue; *ptr = c; if (c == '\n') @@ -116,7 +116,7 @@ int url_to_host_port_path(const char *url, char *host, int *port, char *path) * http://hostname:port/path:foo */ - if(strstr(url, "http://") == url) { + if (strstr(url, "http://") == url) { urlcopy = strdup(url+7); } else { WARNING(("Weird url - unknown protocol: %s", url)); @@ -193,7 +193,7 @@ char *yahoo_urldecode(const char *instr) while(instr[ipos]) { while(instr[ipos] && instr[ipos]!='%') - if(instr[ipos]=='+') { + if (instr[ipos]=='+') { str[bpos++]=' '; ipos++; } else @@ -201,7 +201,7 @@ char *yahoo_urldecode(const char *instr) if (!instr[ipos]) break; - if(instr[ipos+1] && instr[ipos+2]) { + if (instr[ipos+1] && instr[ipos+2]) { ipos++; entity[0]=instr[ipos++]; entity[1]=instr[ipos++]; @@ -240,7 +240,7 @@ char *yahoo_xmldecode(const char *instr) while(instr[ipos]) { while(instr[ipos] && instr[ipos]!='&') - if(instr[ipos]=='+') { + if (instr[ipos]=='+') { str[bpos++]=' '; ipos++; } else @@ -249,7 +249,7 @@ char *yahoo_xmldecode(const char *instr) break; ipos++; - if(instr[ipos] == '#') { + if (instr[ipos] == '#') { ipos++; epos=0; while(instr[ipos] != ';') @@ -290,7 +290,7 @@ static void connect_complete(int fd, int error, void *data) { struct callback_data *ccd = (struct callback_data *) data; - if(error == 0 && fd > 0) + if (error == 0 && fd > 0) write(fd, ccd->request, strlen(ccd->request)); FREE(ccd->request); @@ -386,7 +386,7 @@ static void yahoo_got_url_fd(int id, int fd, int error, void *data) struct url_data *ud = (struct url_data *) data; - if(error || fd < 0) { + if (error || fd < 0) { ud->callback(id, fd, error, filename, filesize, ud->user_data); FREE(ud); return; @@ -400,20 +400,20 @@ static void yahoo_got_url_fd(int id, int fd, int error, void *data) if ( !strncasecmp(buff, "Content-length:", strlen("Content-length:"))) { tmp = strrchr(buff, ' '); - if(tmp) + if (tmp) filesize = atol(tmp); } if ( !strncasecmp(buff, "Content-disposition:", strlen("Content-disposition:"))) { tmp = strstr(buff, "name="); - if(tmp) { + if (tmp) { tmp+=strlen("name="); - if(tmp[0] == '"') { + if (tmp[0] == '"') { char *tmp2; tmp++; tmp2 = strchr(tmp, '"'); - if(tmp2) + if (tmp2) *tmp2 = '\0'; } else { char *tmp2; @@ -422,7 +422,7 @@ static void yahoo_got_url_fd(int id, int fd, int error, void *data) tmp2 = strchr(tmp, '\r'); if (!tmp2) tmp2 = strchr(tmp, '\n'); - if(tmp2) + if (tmp2) *tmp2 = '\0'; } diff --git a/protocols/Yahoo/src/libyahoo2/yahoo_list.c b/protocols/Yahoo/src/libyahoo2/yahoo_list.c index b3e40c208e..42af4e2046 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo_list.c +++ b/protocols/Yahoo/src/libyahoo2/yahoo_list.c @@ -226,7 +226,7 @@ YList *y_list_insert_sorted(YList * list, void *data, YListCompFunc comp) n->next = l; - if(n->prev) { + if (n->prev) { n->prev->next = n; return list; } else { diff --git a/protocols/Yahoo/src/libyahoo2/yahoo_util.c b/protocols/Yahoo/src/libyahoo2/yahoo_util.c index a2de75c050..cd76a77ba7 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo_util.c +++ b/protocols/Yahoo/src/libyahoo2/yahoo_util.c @@ -44,7 +44,7 @@ char * y_string_append(char * string, char * append) int size = strlen(string) + strlen(append) + 1; char * new_string = y_renew(char, string, size); - if(new_string == NULL) { + if (new_string == NULL) { new_string = y_new(char, size); strcpy(new_string, string); FREE(string); @@ -60,7 +60,7 @@ char * y_string_append(char * string, char * append) unsigned int n, i = 0; char *result = NULL; - if(in == NULL || *in == '\0') + if (in == NULL || *in == '\0') return ""; result = y_new(char, strlen(in) * 2 + 1); @@ -86,7 +86,7 @@ char * y_utf8_to_str(const char *in) unsigned int n; char *result = NULL; - if(in == NULL || *in == '\0') + if (in == NULL || *in == '\0') return ""; result = y_new(char, strlen(in) + 1); @@ -122,13 +122,13 @@ char ** y_strsplit(char * str, char * sep, int nelem) char *s, *p; int i=0; int l = strlen(sep); - if(nelem <= 0) { + if (nelem <= 0) { char * s; nelem=0; if (*str) { for(s=strstr(str, sep); s; s=strstr(s+l, sep),nelem++) ; - if(strcmp(str+strlen(str)-l, sep)) + if (strcmp(str+strlen(str)-l, sep)) nelem++; } } @@ -142,7 +142,7 @@ char ** y_strsplit(char * str, char * sep, int nelem) vector[i][len] = '\0'; } - if(i -# define FREE(x) if(x) {g_free(x); x=NULL;} +# define FREE(x) if (x) {g_free(x); x=NULL;} # define y_new g_new # define y_new0 g_new0 @@ -50,7 +50,7 @@ # include # include -# define FREE(x) if(x) {free(x); x=NULL;} +# define FREE(x) if (x) {free(x); x=NULL;} # define y_new(type, n) (type *)malloc(sizeof(type) * (n)) # define y_new0(type, n) (type *)calloc((n), sizeof(type)) -- cgit v1.2.3