diff --git a/src/ChangeLog b/src/ChangeLog index 33c4d13d3..606403e5b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,25 @@ +2004-09-24 Roland Illig + + * boxes.c: Replaced NULL with (char *) NULL. Likewise for 0, where + NULL was meant. + * cmd.c: Likewise. + * dialog.c: Likewise. + * ext.c: Likewise. + * file.c: Likewise. + * find.c: Likewise. + * hotlist.c: Likewise. + * learn.c: Likewise. + * main.c: Likewise. + * screen.c: Likewise. + * setup.c: Likewise. + * treestore.c: Likewise. + * user.c: Likewise. + * util.c: Likewise. + * utilunix.c: Likewise. + * view.c: Likewise. + * widget.c: Likewise. + * wtools.c: Likewise. + 2004-09-24 Roland Illig * cons.handler.c (handle_console_linux): Replaced NULL with diff --git a/src/boxes.c b/src/boxes.c index 2fdade2b8..93860d839 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -227,7 +227,7 @@ display_box (WPanel *panel, char **userp, char **minip, int *use_msformat, int n panel->user_mini_status = 0; for (i = 0; i < LIST_TYPES; i++) panel->user_status_format[i] = g_strdup (DEFAULT_USER_FORMAT); - section = g_strconcat ("Temporal:", p, NULL); + section = g_strconcat ("Temporal:", p, (char *) NULL); if (!profile_has_section (section, profile_name)) { g_free (section); section = g_strdup (p); @@ -886,7 +886,7 @@ jobs_fill_listbox (void) while (tl){ char *s; - s = g_strconcat (state_str [tl->state], " ", tl->info, NULL); + s = g_strconcat (state_str [tl->state], " ", tl->info, (char *) NULL); listbox_add_item (bg_list, LISTBOX_APPEND_AT_END, 0, s, (void *) tl); g_free (s); tl = tl->next; diff --git a/src/cmd.c b/src/cmd.c index 97c91deda..433c8b9eb 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1138,9 +1138,9 @@ nice_cd (const char *text, const char *xtext, const char *help, const char *pref ugly as hell and leads to problems in vfs layer */ if (strncmp (prefix, machine, strlen (prefix)) == 0) - cd_path = g_strconcat (machine, to_home ? "/~/" : NULL, NULL); + cd_path = g_strconcat (machine, to_home ? "/~/" : (char *) NULL, (char *) NULL); else - cd_path = g_strconcat (prefix, machine, to_home ? "/~/" : NULL, NULL); + cd_path = g_strconcat (prefix, machine, to_home ? "/~/" : (char *) NULL, (char *) NULL); if (do_panel_cd (MENU_PANEL, cd_path, 0)) directory_history_add (MENU_PANEL, (MENU_PANEL)->cwd); @@ -1200,7 +1200,7 @@ void quick_cd_cmd (void) char *p = cd_dialog (); if (p && *p) { - char *q = g_strconcat ("cd ", p, NULL); + char *q = g_strconcat ("cd ", p, (char *) NULL); do_cd_command (q); g_free (q); @@ -1239,7 +1239,7 @@ save_setup_cmd (void) save_setup (); sync_profiles (); - str = g_strconcat ( _(" Setup saved to ~/"), PROFILE_NAME, NULL); + str = g_strconcat ( _(" Setup saved to ~/"), PROFILE_NAME, (char *) NULL); message (0, _(" Setup "), str); g_free (str); diff --git a/src/dialog.c b/src/dialog.c index 92fae456c..47e6b6a26 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -210,7 +210,7 @@ create_dlg (int y1, int x1, int lines, int cols, const int *color_set, if (title) { char *t; t = g_strstrip (g_strdup (title)); - new_d->title = g_strconcat (" ", t, " ", NULL); + new_d->title = g_strconcat (" ", t, " ", (char *) NULL); g_free (t); } diff --git a/src/ext.c b/src/ext.c index 5b2fd8f03..718ed7c22 100644 --- a/src/ext.c +++ b/src/ext.c @@ -223,7 +223,7 @@ exec_extension (const char *filename, const char *data, int *move_dir, /* Set executable flag on the command file ... */ chmod (file_name, S_IRWXU); /* ... but don't rely on it - run /bin/sh explicitly */ - cmd = g_strconcat ("/bin/sh ", file_name, NULL); + cmd = g_strconcat ("/bin/sh ", file_name, (char *) NULL); } if (run_view) { @@ -303,7 +303,7 @@ get_file_type_local (char *filename, char *buf, int buflen) int read_bytes = 0; char *tmp = name_quote (filename, 0); - char *command = g_strconcat (FILE_CMD, tmp, NULL); + char *command = g_strconcat (FILE_CMD, tmp, (char *) NULL); FILE *f = popen (command, "r"); g_free (tmp); @@ -468,14 +468,14 @@ regex_command (const char *filename, const char *action, int *move_dir) char *msg2; msg = g_strconcat (" ", mc_home, MC_LIB_EXT, - _(" file error "), NULL); + _(" file error "), (char *) NULL); msg2 = g_strconcat (_("Format of the "), mc_home, _("mc.ext file has changed\n" "with version 3.0. It seems that installation\n" "failed. Please fetch a fresh new copy from the\n" "Midnight Commander package."), - NULL); + (char *) NULL); message (1, msg, "%s", msg2); g_free (msg); g_free (msg2); @@ -487,7 +487,7 @@ regex_command (const char *filename, const char *action, int *move_dir) char *msg; char *msg2; msg = - g_strconcat (" ~/", MC_USER_EXT, _(" file error "), NULL); + g_strconcat (" ~/", MC_USER_EXT, _(" file error "), (char *) NULL); msg2 = g_strconcat (_("Format of the "), "~/", MC_USER_EXT, _(" file has changed\n" @@ -497,7 +497,7 @@ regex_command (const char *filename, const char *action, int *move_dir) "file as an example of how to write it.\n"), mc_home, _("mc.ext will be used for this moment."), - NULL); + (char *) NULL); message (1, msg, "%s", msg2); g_free (msg); g_free (msg2); diff --git a/src/file.c b/src/file.c index a96f36440..ca4025868 100644 --- a/src/file.c +++ b/src/file.c @@ -386,11 +386,11 @@ make_symlink (FileOpContext *ctx, const char *src_path, const char *dst_path) if (*dst_path == PATH_SEP) q = g_strdup (dst_path); else - q = g_strconcat (p, dst_path, NULL); + q = g_strconcat (p, dst_path, (char *) NULL); r = strrchr (q, PATH_SEP); if (r) { r[1] = 0; - s = g_strconcat (p, link_target, NULL); + s = g_strconcat (p, link_target, (char *) NULL); strcpy (link_target, s); g_free (s); s = diff_two_paths (q, link_target); @@ -2198,7 +2198,7 @@ real_query_recursive (FileOpContext *ctx, enum OperationMode mode, const char *s " Delete it recursively? ") : _("\n Background process: Directory not empty \n" " Delete it recursively? "); - text = g_strconcat (_(" Delete: "), name_trunc (s, 30), " ", NULL); + text = g_strconcat (_(" Delete: "), name_trunc (s, 30), " ", (char *) NULL); if (safe_delete) query_set_sel (1); diff --git a/src/find.c b/src/find.c index 2405a36d3..cf5ff26f8 100644 --- a/src/find.c +++ b/src/find.c @@ -370,7 +370,7 @@ insert_file (const char *dir, const char *file) dirname = add_to_list (dir, NULL); } - tmp_name = g_strconcat (" ", file, NULL); + tmp_name = g_strconcat (" ", file, (char *) NULL); add_to_list (tmp_name, dirname); g_free (tmp_name); } @@ -608,7 +608,7 @@ do_search (struct Dlg_head *h) } if (find_ignore_dirs){ int found; - char *temp_dir = g_strconcat (":", tmp, ":", NULL); + char *temp_dir = g_strconcat (":", tmp, ":", (char *) NULL); found = strstr (find_ignore_dirs, temp_dir) != 0; g_free (temp_dir); diff --git a/src/hotlist.c b/src/hotlist.c index a37dc04d8..6c12e852d 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -186,7 +186,7 @@ update_path_name (void) label_set_text (pname, name_trunc (text, dlg->cols - (UX * 2 + 4))); - p = g_strconcat (" ", current_group->label, " ", NULL); + p = g_strconcat (" ", current_group->label, " ", (char *) NULL); if (!hotlist_state.moving) label_set_text (pname_group, name_trunc (p, dlg->cols - (UX * 2 + 4))); @@ -449,7 +449,7 @@ hotlist_callback (Dlg_head *h, dlg_msg_t msg, int parm) (struct hotlist *) l_hotlist->current->data; if (hlp->type == HL_TYPE_ENTRY) { char *tmp = - g_strconcat ("cd ", hlp->directory, NULL); + g_strconcat ("cd ", hlp->directory, (char *) NULL); stuff (cmdline, tmp, 0); g_free (tmp); dlg_stop (h); @@ -719,7 +719,7 @@ static void hotlist_done (void) static char * find_group_section (struct hotlist *grp) { - return g_strconcat (grp->directory, ".Group", NULL); + return g_strconcat (grp->directory, ".Group", (char *) NULL); } @@ -780,7 +780,7 @@ add2hotlist (char *label, char *directory, enum HotListType type, int pos) if (hotlist_state.running && type != HL_TYPE_COMMENT) { if (type == HL_TYPE_GROUP) { - char *lbl = g_strconcat ("->", new->label, NULL); + char *lbl = g_strconcat ("->", new->label, (char *) NULL); listbox_add_item (l_hotlist, pos, 0, lbl, new); g_free (lbl); @@ -1355,7 +1355,7 @@ clean_up_hotlist_groups (const char *section) void *profile_keys; char *key, *value; - grp_section = g_strconcat (section, ".Group", NULL); + grp_section = g_strconcat (section, ".Group", (char *) NULL); if (profile_has_section (section, profile_name)) profile_clean_section (section, profile_name); if (profile_has_section (grp_section, profile_name)) { @@ -1415,7 +1415,7 @@ load_hotlist (void) char *msg; msg = g_strconcat (_("MC was unable to write ~/"), HOTLIST_FILENAME, - _(" file, your old hotlist entries were not deleted"), NULL); + _(" file, your old hotlist entries were not deleted"), (char *) NULL); message (D_ERROR, _(" Hotlist Load "), msg); g_free (msg); @@ -1534,7 +1534,7 @@ int save_hotlist (void) struct stat stat_buf; if (!hotlist_state.readonly && hotlist_state.modified && hotlist_file_name) { - char *fbak = g_strconcat (hotlist_file_name, ".bak", NULL); + char *fbak = g_strconcat (hotlist_file_name, ".bak", (char *) NULL); rename (hotlist_file_name, fbak); if ((hotlist_file = fopen (hotlist_file_name, "w")) != 0) { diff --git a/src/learn.c b/src/learn.c index dd4daceed..89a7dfc28 100644 --- a/src/learn.c +++ b/src/learn.c @@ -306,7 +306,7 @@ learn_save (void) { int i; int profile_changed = 0; - char *section = g_strconcat ("terminal:", getenv ("TERM"), NULL); + char *section = g_strconcat ("terminal:", getenv ("TERM"), (char *) NULL); for (i = 0; i < learn_total; i++) { if (learnkeys [i].sequence != NULL) { diff --git a/src/main.c b/src/main.c index e8ba60355..dd454f992 100644 --- a/src/main.c +++ b/src/main.c @@ -2098,7 +2098,7 @@ static int do_mc_filename_rename (const char *mc_dir, const char *o_name, const char *n_name) { char *full_o_name = concat_dir_and_file (home_dir, o_name); - char *full_n_name = g_strconcat (home_dir, MC_BASE, n_name, NULL); + char *full_n_name = g_strconcat (home_dir, MC_BASE, n_name, (char *) NULL); int move; move = 0 == rename (full_o_name, full_n_name); diff --git a/src/screen.c b/src/screen.c index 02cec5e76..c5a8565f4 100644 --- a/src/screen.c +++ b/src/screen.c @@ -901,7 +901,7 @@ panel_save_name (WPanel *panel) if ((midnight_shutdown && auto_save_setup) || saving_setup) return g_strdup (panel->panel_name); else - return g_strconcat ("Temporal:", panel->panel_name, NULL); + return g_strconcat ("Temporal:", panel->panel_name, (char *) NULL); } static void @@ -963,7 +963,7 @@ panel_new (const char *panel_name) mc_get_current_wd (panel->cwd, sizeof (panel->cwd) - 2); strcpy (panel->lwd, "."); - panel->hist_name = g_strconcat ("Dir Hist ", panel_name, NULL); + panel->hist_name = g_strconcat ("Dir Hist ", panel_name, (char *) NULL); panel->dir_history = history_get (panel->hist_name); directory_history_add (panel, panel->cwd); @@ -993,7 +993,7 @@ panel_new (const char *panel_name) panel->search_buffer[0] = 0; panel->frame_size = frame_half; - section = g_strconcat ("Temporal:", panel->panel_name, NULL); + section = g_strconcat ("Temporal:", panel->panel_name, (char *) NULL); if (!profile_has_section (section, profile_name)) { g_free (section); section = g_strdup (panel->panel_name); @@ -1280,7 +1280,7 @@ parse_display_format (WPanel *panel, const char *format, char **error, int issta int pos = min (8, strlen (format)); delete_format (home); tmp_format [pos] = 0; - *error = g_strconcat (_("Unknown tag on display format: "), tmp_format, NULL); + *error = g_strconcat (_("Unknown tag on display format: "), tmp_format, (char *) NULL); g_free (tmp_format); return 0; } @@ -1964,7 +1964,7 @@ do_enter_on_file_entry (file_entry *fe) { char *tmp = name_quote (fe->fname, 0); - char *cmd = g_strconcat (".", PATH_SEP_STR, tmp, NULL); + char *cmd = g_strconcat (".", PATH_SEP_STR, tmp, (char *) NULL); g_free (tmp); shell_execute (cmd, 0); g_free (cmd); diff --git a/src/setup.c b/src/setup.c index 34f93bfe0..013b4e39a 100644 --- a/src/setup.c +++ b/src/setup.c @@ -527,7 +527,7 @@ load_setup (void) load_string ("Misc", "find_ignore_dirs", "", setup_color_string, sizeof (setup_color_string)); if (setup_color_string [0]) - find_ignore_dirs = g_strconcat (":", setup_color_string, ":", NULL); + find_ignore_dirs = g_strconcat (":", setup_color_string, ":", (char *) NULL); /* The default color and the terminal dependent color */ load_string ("Colors", "base_color", "", setup_color_string, @@ -593,7 +593,7 @@ load_keys_from_section (const char *terminal, const char *profile_name) if (!terminal) return; - section_name = g_strconcat ("terminal:", terminal, NULL); + section_name = g_strconcat ("terminal:", terminal, (char *) NULL); profile_keys = profile_init_iterator (section_name, profile_name); g_free (section_name); while (profile_keys){ diff --git a/src/treestore.c b/src/treestore.c index bec0a3f1c..f48f8c7e3 100644 --- a/src/treestore.c +++ b/src/treestore.c @@ -601,7 +601,7 @@ tree_store_mark_checked(const char *subname) (subname[1] == 0 || (subname[1] == '.' && subname[2] == 0))) return; if (ts.check_name[0] == PATH_SEP && ts.check_name[1] == 0) - name = g_strconcat(PATH_SEP_STR, subname, NULL); + name = g_strconcat(PATH_SEP_STR, subname, (char *) NULL); else name = concat_dir_and_file(ts.check_name, subname); diff --git a/src/user.c b/src/user.c index 399dd0171..f55712c86 100644 --- a/src/user.c +++ b/src/user.c @@ -214,7 +214,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote) case 'k': /* block file name */ case 'b': /* block file name / strip extension */ { if (edit_widget) { - char *file = g_strconcat (home_dir, BLOCK_FILE, NULL); + char *file = g_strconcat (home_dir, BLOCK_FILE, (char *) NULL); fname = (*quote_func) (file, 0); g_free (file); return fname; diff --git a/src/util.c b/src/util.c index f1c290693..421650c50 100644 --- a/src/util.c +++ b/src/util.c @@ -640,7 +640,7 @@ load_mc_home_file (const char *filename, char **allocated_filename) hintfile_base = concat_dir_and_file (mc_home, filename); lang = guess_message_value (); - hintfile = g_strconcat (hintfile_base, ".", lang, NULL); + hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL); data = load_file (hintfile); if (!data) { @@ -648,7 +648,7 @@ load_mc_home_file (const char *filename, char **allocated_filename) /* Fall back to the two-letter language code */ if (lang[0] && lang[1]) lang[2] = 0; - hintfile = g_strconcat (hintfile_base, ".", lang, NULL); + hintfile = g_strconcat (hintfile_base, ".", lang, (char *) NULL); data = load_file (hintfile); if (!data) { @@ -1182,9 +1182,9 @@ concat_dir_and_file (const char *dir, const char *file) int i = strlen (dir); if (dir [i-1] == PATH_SEP) - return g_strconcat (dir, file, NULL); + return g_strconcat (dir, file, (char *) NULL); else - return g_strconcat (dir, PATH_SEP_STR, file, NULL); + return g_strconcat (dir, PATH_SEP_STR, file, (char *) NULL); } @@ -1254,7 +1254,7 @@ mc_mkstemps (char **pname, const char *prefix, const char *suffix) tmpbase = g_strdup (prefix); } - tmpname = g_strconcat (tmpbase, "XXXXXX", suffix, NULL); + tmpname = g_strconcat (tmpbase, "XXXXXX", suffix, (char *) NULL); *pname = tmpname; XXXXXX = &tmpname[strlen (tmpbase)]; g_free (tmpbase); diff --git a/src/util.h b/src/util.h index 4580ff622..52fabda9d 100644 --- a/src/util.h +++ b/src/util.h @@ -211,7 +211,7 @@ void save_file_position (const char *filename, long line, long column); /* this function allows you to write: * char *s = g_strdup("hello, world"); - * s = free_after(g_strconcat(s, s, NULL), s); + * s = free_after(g_strconcat(s, s, (char *) NULL), s); */ static inline char * free_after (char *result, char *string_to_free) diff --git a/src/utilunix.c b/src/utilunix.c index 527c17b6d..5b2f39db1 100644 --- a/src/utilunix.c +++ b/src/utilunix.c @@ -290,7 +290,7 @@ tilde_expand (const char *directory) if (!passwd) return g_strdup (directory); - return g_strconcat (passwd->pw_dir, PATH_SEP_STR, q, NULL); + return g_strconcat (passwd->pw_dir, PATH_SEP_STR, q, (char *) NULL); } diff --git a/src/view.c b/src/view.c index dbfdd8699..3e6505934 100644 --- a/src/view.c +++ b/src/view.c @@ -671,7 +671,7 @@ do_view_init (WView *view, const char *_command, const char *_file, if (view->viewer_magic_flag && (type != COMPRESSION_NONE)) { g_free (view->filename); view->filename = - g_strconcat (_file, decompress_extension (type), NULL); + g_strconcat (_file, decompress_extension (type), (char *) NULL); } error = load_view_file (view, fd); diff --git a/src/widget.c b/src/widget.c index 608034999..6876075f2 100644 --- a/src/widget.c +++ b/src/widget.c @@ -2398,7 +2398,7 @@ groupbox_new (int x, int y, int width, int height, const char *title) if (title) { char *t; t = g_strstrip (g_strdup (title)); - g->title = g_strconcat (" ", t, " ", NULL); + g->title = g_strconcat (" ", t, " ", (char *) NULL); g_free (t); } diff --git a/src/wtools.c b/src/wtools.c index f5fb4e2a5..ea56508e3 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -200,7 +200,7 @@ do_create_message (int flags, const char *title, const char *text) Dlg_head *d; /* Add empty lines before and after the message */ - p = g_strconcat ("\n", text, "\n", NULL); + p = g_strconcat ("\n", text, "\n", (char *) NULL); query_dialog (title, p, flags, 0); d = last_query_dlg; init_dlg (d); @@ -253,7 +253,7 @@ fg_message (int flags, const char *title, const char *text) static void bg_message (int dummy, int *flags, char *title, const char *text) { - title = g_strconcat (_("Background process:"), " ", title, NULL); + title = g_strconcat (_("Background process:"), " ", title, (char *) NULL); fg_message (*flags, title, text); g_free (title); }