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/gtk/resources.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/gtk/resources.c')
-rw-r--r-- | frontends/gtk/resources.c | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/frontends/gtk/resources.c b/frontends/gtk/resources.c index 4f9afb034..c07548b01 100644 --- a/frontends/gtk/resources.c +++ b/frontends/gtk/resources.c @@ -198,7 +198,8 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) /* found an entry in the resources */ resource->path = resname; resource->type = NSGTK_RESOURCE_GLIB; - LOG("Found gresource path %s", resource->path); + NSLOG(netsurf, INFO, "Found gresource path %s", + resource->path); return NSERROR_OK; } /*LOG("gresource \"%s\" not found", resname);*/ @@ -221,7 +222,8 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) /* found an entry in the resources */ resource->path = resname; resource->type = NSGTK_RESOURCE_GLIB; - LOG("Found gresource path %s", resource->path); + NSLOG(netsurf, INFO, "Found gresource path %s", + resource->path); return NSERROR_OK; } /*LOG("gresource \"%s\" not found", resname);*/ @@ -231,8 +233,9 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) resname = filepath_find(respath, resource->name); if (resname == NULL) { - LOG("Unable to find resource %s on resource path", - resource->name); + NSLOG(netsurf, INFO, + "Unable to find resource %s on resource path", + resource->name); return NSERROR_NOT_FOUND; } @@ -240,7 +243,7 @@ init_resource(char **respath, struct nsgtk_resource_s *resource) resource->path = resname; resource->type = NSGTK_RESOURCE_FILE; - LOG("Found file resource path %s", resource->path); + NSLOG(netsurf, INFO, "Found file resource path %s", resource->path); return NSERROR_OK; } @@ -295,21 +298,21 @@ init_pixbuf_resource(char **respath, struct nsgtk_resource_s *resource) if (strncmp(resource->name, "menu_cursor.png", resource->len) == 0) { resource->path = (char *)&menu_cursor_pixdata[0]; resource->type = NSGTK_RESOURCE_INLINE; - LOG("Found builtin for %s", resource->name); + NSLOG(netsurf, INFO, "Found builtin for %s", resource->name); return NSERROR_OK; } if (strncmp(resource->name, "netsurf.xpm", resource->len) == 0) { resource->path = (char *)&netsurf_pixdata[0]; resource->type = NSGTK_RESOURCE_INLINE; - LOG("Found builtin for %s", resource->name); + NSLOG(netsurf, INFO, "Found builtin for %s", resource->name); return NSERROR_OK; } if (strncmp(resource->name, "favicon.png", resource->len) == 0) { resource->path = (char *)&favicon_pixdata[0]; resource->type = NSGTK_RESOURCE_INLINE; - LOG("Found builtin for %s", resource->name); + NSLOG(netsurf, INFO, "Found builtin for %s", resource->name); return NSERROR_OK; } #endif @@ -389,13 +392,13 @@ static void list_gresource(void) G_RESOURCE_LOOKUP_FLAGS_NONE, &gerror); if (gerror) { - LOG("gerror %s", gerror->message); + NSLOG(netsurf, INFO, "gerror %s", gerror->message); g_error_free(gerror); } else { cur = reslist; while (cur != NULL && *cur != NULL) { - LOG("gres %s", *cur); + NSLOG(netsurf, INFO, "gres %s", *cur); cur++; } g_strfreev(reslist); @@ -488,12 +491,17 @@ nsgdk_pixbuf_new_from_resname(const char *resname, GdkPixbuf **pixbuf_out) if (new_pixbuf == NULL) { if (error != NULL) { - LOG("Unable to create pixbuf from file for %s with path %s \"%s\"", - resource->name, resource->path, error->message); + NSLOG(netsurf, INFO, + "Unable to create pixbuf from file for %s with path %s \"%s\"", + resource->name, + resource->path, + error->message); g_error_free(error); } else { - LOG("Unable to create pixbuf from file for %s with path %s", - resource->name, resource->path); + NSLOG(netsurf, INFO, + "Unable to create pixbuf from file for %s with path %s", + resource->name, + resource->path); } return NSERROR_INIT_FAILED; } @@ -521,8 +529,11 @@ nsgtk_builder_new_from_resname(const char *resname, GtkBuilder **builder_out) if (!gtk_builder_add_from_file(new_builder, ui_res->path, &error)) { - LOG("Unable to add UI builder from file for %s with path %s \"%s\"", - ui_res->name, ui_res->path, error->message); + NSLOG(netsurf, INFO, + "Unable to add UI builder from file for %s with path %s \"%s\"", + ui_res->name, + ui_res->path, + error->message); g_error_free(error); g_object_unref(G_OBJECT(new_builder)); return NSERROR_INIT_FAILED; @@ -531,8 +542,11 @@ nsgtk_builder_new_from_resname(const char *resname, GtkBuilder **builder_out) if (!nsgtk_builder_add_from_resource(new_builder, ui_res->path, &error)) { - LOG("Unable to add UI builder from resource for %s with path %s \"%s\"", - ui_res->name, ui_res->path, error->message); + NSLOG(netsurf, INFO, + "Unable to add UI builder from resource for %s with path %s \"%s\"", + ui_res->name, + ui_res->path, + error->message); g_error_free(error); g_object_unref(G_OBJECT(new_builder)); return NSERROR_INIT_FAILED; |