diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-09-06 18:28:12 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-09-06 18:45:27 +0100 |
commit | 75018632a9b953aafeae6f4e8aea607fd1d89dca (patch) | |
tree | d661d2fded2ad4b80c4cf019dee2954c052ab090 /frontends/riscos/filetype.c | |
parent | 8d9b2efc11529da8cb5870b39ff15249c648b10a (diff) | |
download | netsurf-75018632a9b953aafeae6f4e8aea607fd1d89dca.tar.gz netsurf-75018632a9b953aafeae6f4e8aea607fd1d89dca.tar.bz2 |
Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done
@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
Diffstat (limited to 'frontends/riscos/filetype.c')
-rw-r--r-- | frontends/riscos/filetype.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/frontends/riscos/filetype.c b/frontends/riscos/filetype.c index 75ff41414..73651cd63 100644 --- a/frontends/riscos/filetype.c +++ b/frontends/riscos/filetype.c @@ -72,7 +72,7 @@ const char *fetch_filetype(const char *unix_path) int objtype; if (!path) { - LOG("Insufficient memory for calloc"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc"); ro_warn_user("NoMemory", 0); return "application/riscos"; } @@ -80,7 +80,7 @@ const char *fetch_filetype(const char *unix_path) /* convert path to RISC OS format and read file type */ r = __riscosify(unix_path, 0, __RISCOSIFY_NO_SUFFIX, path, len, 0); if (r == 0) { - LOG("__riscosify failed"); + NSLOG(netsurf, INFO, "__riscosify failed"); free(path); return "application/riscos"; } @@ -88,7 +88,9 @@ const char *fetch_filetype(const char *unix_path) error = xosfile_read_stamped_no_path(path, &objtype, 0, 0, 0, 0, &file_type); if (error) { - LOG("xosfile_read_stamped_no_path failed: %s", error->errmess); + NSLOG(netsurf, INFO, + "xosfile_read_stamped_no_path failed: %s", + error->errmess); free(path); return "application/riscos"; } @@ -108,7 +110,10 @@ const char *fetch_filetype(const char *unix_path) slash+1, &temp); if (error) /* ignore error and leave file_type alone */ - LOG("xmimemaptranslate_extension_to_filetype: ""0x%x %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, + "xmimemaptranslate_extension_to_filetype: ""0x%x %s", + error->errnum, + error->errmess); else file_type = temp; } @@ -126,7 +131,7 @@ const char *fetch_filetype(const char *unix_path) /* not in internal table, so ask MimeMap */ error = xmimemaptranslate_filetype_to_mime_type(file_type, type_buf); if (error) { - LOG("0x%x %s", error->errnum, error->errmess); + NSLOG(netsurf, INFO, "0x%x %s", error->errnum, error->errmess); free(path); return "application/riscos"; } @@ -139,7 +144,7 @@ const char *fetch_filetype(const char *unix_path) free(path); - LOG("mime type '%s'", type_buf); + NSLOG(netsurf, INFO, "mime type '%s'", type_buf); return (const char *)type_buf; } @@ -155,14 +160,15 @@ char *fetch_mimetype(const char *ro_path) struct type_entry *t; if (!mime) { - LOG("Insufficient memory for calloc"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc"); ro_warn_user("NoMemory", 0); return 0; } e = xosfile_read_no_path(ro_path, &objtype, &load, 0, 0, 0); if (e) { - LOG("xosfile_read_no_path: 0x%x: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "xosfile_read_no_path: 0x%x: %s", + e->errnum, e->errmess); free(mime); return 0; } @@ -188,7 +194,7 @@ char *fetch_mimetype(const char *ro_path) if (e) /* if we get an error here, simply ignore it and * leave filetype unchanged */ - LOG("0x%x %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, "0x%x %s", e->errnum, e->errmess); else filetype = load; } @@ -205,7 +211,10 @@ char *fetch_mimetype(const char *ro_path) /* not in internal table, so ask MimeMap */ e = xmimemaptranslate_filetype_to_mime_type(filetype, mime); if (e) { - LOG("xmimemaptranslate_filetype_to_mime_type: 0x%x: %s", e->errnum, e->errmess); + NSLOG(netsurf, INFO, + "xmimemaptranslate_filetype_to_mime_type: 0x%x: %s", + e->errnum, + e->errmess); free(mime); return 0; } @@ -322,7 +331,7 @@ bits ro_filetype_from_unix_path(const char *unix_path) bits file_type; if (!path) { - LOG("Insufficient memory for calloc"); + NSLOG(netsurf, INFO, "Insufficient memory for calloc"); ro_warn_user("NoMemory", 0); return osfile_TYPE_DATA; } @@ -330,7 +339,7 @@ bits ro_filetype_from_unix_path(const char *unix_path) /* convert path to RISC OS format and read file type */ r = __riscosify(unix_path, 0, __RISCOSIFY_NO_SUFFIX, path, len, 0); if (r == 0) { - LOG("__riscosify failed"); + NSLOG(netsurf, INFO, "__riscosify failed"); free(path); return osfile_TYPE_DATA; } @@ -338,7 +347,9 @@ bits ro_filetype_from_unix_path(const char *unix_path) error = xosfile_read_stamped_no_path(path, 0, 0, 0, 0, 0, &file_type); if (error) { - LOG("xosfile_read_stamped_no_path failed: %s", error->errmess); + NSLOG(netsurf, INFO, + "xosfile_read_stamped_no_path failed: %s", + error->errmess); free(path); return osfile_TYPE_DATA; } |