Mercurial > mplayer.hg
changeset 34578:948bec0f8df3
Cosmetic: Change some variable names.
author | ib |
---|---|
date | Thu, 09 Feb 2012 13:43:23 +0000 |
parents | 22887c794c02 |
children | 5097d56b31b1 |
files | gui/cfg.c gui/skin/font.c gui/skin/skin.c |
diffstat | 3 files changed, 70 insertions(+), 70 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/cfg.c Thu Feb 09 13:25:05 2012 +0000 +++ b/gui/cfg.c Thu Feb 09 13:43:23 2012 +0000 @@ -240,16 +240,16 @@ void cfg_read(void) { - char *cfg; - FILE *f; + char *fname; + FILE *file; player_idle_mode = 1; // GUI is in idle mode by default // configuration - cfg = get_path(GUI_CONFIGURATION); + fname = get_path(GUI_CONFIGURATION); - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", cfg); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[cfg] file: %s\n", fname); gui_conf = m_config_new(); @@ -260,49 +260,49 @@ m_config_register_options(gui_conf, gui_opts); - if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, cfg, 1) < 0)) { + if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, fname, 1) < 0)) { gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_ConfigFileError "\n"); mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); } - free(cfg); + free(fname); // playlist - cfg = get_path(GUI_PLAYLIST); - f = fopen(cfg, "rt"); + fname = get_path(GUI_PLAYLIST); + file = fopen(fname, "rt"); - if (f) { - while (!feof(f)) { + if (file) { + while (!feof(file)) { char tmp[512]; plItem *item; - if (fgetstr(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, file) == NULL) continue; item = calloc(1, sizeof(plItem)); item->path = strdup(tmp); - fgetstr(tmp, 512, f); + fgetstr(tmp, 512, file); item->name = strdup(tmp); listSet(gtkAddPlItem, item); } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // URL list - cfg = get_path(GUI_URLLIST); - f = fopen(cfg, "rt"); + fname = get_path(GUI_URLLIST); + file = fopen(fname, "rt"); - if (f) { - while (!feof(f)) { + if (file) { + while (!feof(file)) { char tmp[512]; urlItem *item; - if (fgetstr(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, file) == NULL) continue; item = calloc(1, sizeof(urlItem)); @@ -310,120 +310,120 @@ listSet(gtkAddURLItem, item); } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // directory history - cfg = get_path(GUI_HISTORY); - f = fopen(cfg, "rt+"); + fname = get_path(GUI_HISTORY); + file = fopen(fname, "rt+"); - if (f) { + if (file) { int i = 0; - while (!feof(f)) { + while (!feof(file)) { char tmp[512]; - if (fgetstr(tmp, 512, f) == NULL) + if (fgetstr(tmp, 512, file) == NULL) continue; fsHistory[i++] = gstrdup(tmp); } - fclose(f); + fclose(file); } - free(cfg); + free(fname); } void cfg_write(void) { - char *cfg; - FILE *f; + char *fname; + FILE *file; int i; // configuration - cfg = get_path(GUI_CONFIGURATION); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_CONFIGURATION); + file = fopen(fname, "wt+"); - if (f) { + if (file) { for (i = 0; gui_opts[i].name; i++) { - char *v = m_option_print(&gui_opts[i], gui_opts[i].p); + char *val = m_option_print(&gui_opts[i], gui_opts[i].p); - if (v == (char *)-1) { + if (val == (char *)-1) { mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, gui_opts[i].name); - v = NULL; + val = NULL; } - if (v) { - fprintf(f, "%s = \"%s\"\n", gui_opts[i].name, v); - free(v); + if (val) { + fprintf(file, "%s = \"%s\"\n", gui_opts[i].name, val); + free(val); } } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // playlist - cfg = get_path(GUI_PLAYLIST); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_PLAYLIST); + file = fopen(fname, "wt+"); - if (f) { + if (file) { plCurrent = plList; while (plCurrent) { if (plCurrent->path && plCurrent->name) { - fprintf(f, "%s\n", plCurrent->path); - fprintf(f, "%s\n", plCurrent->name); + fprintf(file, "%s\n", plCurrent->path); + fprintf(file, "%s\n", plCurrent->name); } plCurrent = plCurrent->next; } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // URL list - cfg = get_path(GUI_URLLIST); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_URLLIST); + file = fopen(fname, "wt+"); - if (f) { + if (file) { while (urlList) { if (urlList->url) - fprintf(f, "%s\n", urlList->url); + fprintf(file, "%s\n", urlList->url); urlList = urlList->next; } - fclose(f); + fclose(file); } - free(cfg); + free(fname); // directory history - cfg = get_path(GUI_HISTORY); - f = fopen(cfg, "wt+"); + fname = get_path(GUI_HISTORY); + file = fopen(fname, "wt+"); - if (f) { + if (file) { int i = 0; // while (fsHistory[i] != NULL) for (i = 0; i < 5; i++) if (fsHistory[i]) - fprintf(f, "%s\n", fsHistory[i]); + fprintf(file, "%s\n", fsHistory[i]); - fclose(f); + fclose(file); } - free(cfg); + free(fname); }
--- a/gui/skin/font.c Thu Feb 09 13:25:05 2012 +0000 +++ b/gui/skin/font.c Thu Feb 09 13:43:23 2012 +0000 @@ -104,7 +104,7 @@ */ int fntRead(char *path, char *fname) { - FILE *f; + FILE *file; unsigned char buf[512]; unsigned char item[32]; unsigned char param[256]; @@ -118,14 +118,14 @@ av_strlcpy(buf, path, sizeof(buf)); av_strlcat(buf, fname, sizeof(buf)); av_strlcat(buf, ".fnt", sizeof(buf)); - f = fopen(buf, "rt"); + file = fopen(buf, "rt"); - if (!f) { + if (!file) { nfree(Fonts[id]); return -3; } - while (fgetstr(buf, sizeof(buf), f)) { + while (fgetstr(buf, sizeof(buf), file)) { strswap(buf, '\t', ' '); trim(buf); decomment(buf); @@ -182,13 +182,13 @@ if (skinImageRead(buf, &Fonts[id]->Bitmap) != 0) { bpFree(&Fonts[id]->Bitmap); nfree(Fonts[id]); - fclose(f); + fclose(file); return -4; } } } - fclose(f); + fclose(file); return 0; }
--- a/gui/skin/skin.c Thu Feb 09 13:25:05 2012 +0000 +++ b/gui/skin/skin.c Thu Feb 09 13:43:23 2012 +0000 @@ -1030,7 +1030,7 @@ int skinRead(char *sname) { char *skinfname; - FILE *skinFile; + FILE *skinfile; unsigned char line[256]; unsigned char item[32]; unsigned char param[256]; @@ -1038,10 +1038,10 @@ skinfname = setname(skinDirInHome, sname); - if ((skinFile = fopen(skinfname, "rt")) == NULL) { + if ((skinfile = fopen(skinfname, "rt")) == NULL) { skinfname = setname(skinMPlayerDir, sname); - if ((skinFile = fopen(skinfname, "rt")) == NULL) { + if ((skinfile = fopen(skinfname, "rt")) == NULL) { mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SkinFileNotFound, skinfname); return -1; } @@ -1055,7 +1055,7 @@ currWinName[0] = 0; linenumber = 0; - while (fgetstr(line, sizeof(line), skinFile)) { + while (fgetstr(line, sizeof(line), skinfile)) { linenumber++; strswap(line, '\t', ' ');