From 0eb321bf2c1cc0e048faff26a01f86cdd3ec254f Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 7 Jul 2009 02:26:13 +0300 Subject: Remove trailing whitespace from most files --- libmenu/menu.c | 28 ++++++++++++++-------------- libmenu/menu.h | 4 ++-- libmenu/menu_chapsel.c | 4 ++-- libmenu/menu_cmdlist.c | 4 ++-- libmenu/menu_console.c | 20 ++++++++++---------- libmenu/menu_dvbin.c | 32 ++++++++++++++++---------------- libmenu/menu_filesel.c | 14 +++++++------- libmenu/menu_list.c | 13 ++++++------- libmenu/menu_list.h | 2 +- libmenu/menu_param.c | 10 +++++----- libmenu/menu_pt.c | 6 +++--- libmenu/menu_txt.c | 6 +++--- libmenu/vf_menu.c | 9 +++------ 13 files changed, 74 insertions(+), 78 deletions(-) (limited to 'libmenu') diff --git a/libmenu/menu.c b/libmenu/menu.c index ed67cc9f2e..3ba54be45c 100644 --- a/libmenu/menu.c +++ b/libmenu/menu.c @@ -59,7 +59,7 @@ menu_info_t* menu_info_list[] = { &menu_info_console, #ifdef CONFIG_DVBIN &menu_info_dvbsel, -#endif +#endif &menu_info_pref, NULL }; @@ -225,7 +225,7 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig) } } - + /// This will build the menu_defs list from the cfg file #define BUF_STEP 1024 @@ -562,7 +562,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt, // Find the first line if(align & MENU_TEXT_VCENTER) sy = ymin + ((h - need_h)/2); - else if(align & MENU_TEXT_BOT) + else if(align & MENU_TEXT_BOT) sy = ymax - need_h - 1; else sy = y; @@ -574,7 +574,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt, else if(align & MENU_TEXT_RIGHT) sx = xmax - need_w; #endif - + xmid = xmin + (xmax - xmin) / 2; xrmin = xmin; // Clamp the bb to the mpi size @@ -582,7 +582,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt, if(xmin < 0) xmin = 0; if(ymax > mpi->h) ymax = mpi->h; if(xmax > mpi->w) xmax = mpi->w; - + // Jump some the beginnig text if needed while(sy < ymin && *txt) { int c=utf8_get_char((const char**)&txt); @@ -682,7 +682,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt, sy += vo_font->height + vspace; } } - + int menu_text_length(char* txt) { int l = 0; render_txt(txt); @@ -714,7 +714,7 @@ void menu_text_size(char* txt,int max_width, int vspace, int warp, int* _w, int* i -= vo_font->charspace; if (i > w) w = i; } - + *_w = w; *_h = (l-1) * (vo_font->height + vspace) + vo_font->height; } @@ -734,7 +734,7 @@ int menu_text_num_lines(char* txt, int max_width) { } return l; } - + static char* menu_text_get_next_line(char* txt, int max_width) { int i = 0; render_txt(txt); @@ -756,22 +756,22 @@ static char* menu_text_get_next_line(char* txt, int max_width) { void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x, int y, int w, int h) { draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt); int g; - + if(!draw_alpha) { mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] Unsupported output format!!!!\n"); return; } - + if(x > mpi->w || y > mpi->h) return; - + if(x < 0) w += x, x = 0; if(x+w > mpi->w) w = mpi->w-x; if(y < 0) h += y, y = 0; if(y+h > mpi->h) h = mpi->h-y; - + g = ((256-alpha)*grey)>>8; if(g < 1) g = 1; - + { int stride = (w+7)&(~7); // round to 8 char pic[stride*h],pic_alpha[stride*h]; @@ -781,5 +781,5 @@ void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x mpi->planes[0] + y * mpi->stride[0] + x * (mpi->bpp>>3), mpi->stride[0]); } - + } diff --git a/libmenu/menu.h b/libmenu/menu.h index 58a3df4c46..cc76b5b7a3 100644 --- a/libmenu/menu.h +++ b/libmenu/menu.h @@ -63,7 +63,7 @@ typedef struct menu_info_s { #define MENU_CMD_OK 2 #define MENU_CMD_CANCEL 3 #define MENU_CMD_LEFT 4 -#define MENU_CMD_RIGHT 5 +#define MENU_CMD_RIGHT 5 #define MENU_CMD_ACTION 6 #define MENU_CMD_HOME 7 #define MENU_CMD_END 8 @@ -106,7 +106,7 @@ void menu_draw_text(mp_image_t* mpi, char* txt, int x, int y); int menu_text_length(char* txt); int menu_text_num_lines(char* txt, int max_width); -void menu_text_size(char* txt,int max_width, +void menu_text_size(char* txt,int max_width, int vspace, int warp, int* _w, int* _h); diff --git a/libmenu/menu_chapsel.c b/libmenu/menu_chapsel.c index 35eac8833f..f350655311 100644 --- a/libmenu/menu_chapsel.c +++ b/libmenu/menu_chapsel.c @@ -71,8 +71,8 @@ static m_option_t cfg_fields[] = { static char *fmt_replace(const char *fmt, const char *chapter_name, const char *start) { - static const char ctag[] = "${chapter_name}"; - static const char stag[] = "${start}"; + static const char ctag[] = "${chapter_name}"; + static const char stag[] = "${start}"; int l = strlen(fmt); int cl = strlen(chapter_name); int sl = strlen(start); diff --git a/libmenu/menu_cmdlist.c b/libmenu/menu_cmdlist.c index 5516af1ff6..60146e31f1 100644 --- a/libmenu/menu_cmdlist.c +++ b/libmenu/menu_cmdlist.c @@ -122,7 +122,7 @@ static int parse_args(menu_t* menu,char* args) { mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] syntax error at line: %d\n",parser->line); asx_parser_free(parser); return -1; - } else if(r == 0) { + } else if(r == 0) { asx_parser_free(parser); if(!m) mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] No entry found in the menu definition.\n"); @@ -160,7 +160,7 @@ static int open_cmdlist(menu_t* menu, char* args) { mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] List menu needs an argument.\n"); return 0; } - + menu_list_init(menu); if(!parse_args(menu,args)) return 0; diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c index 85aa7a9234..8070ff63a3 100644 --- a/libmenu/menu_console.c +++ b/libmenu/menu_console.c @@ -67,7 +67,7 @@ struct menu_priv_s { history_t* history; history_t* cur_history; int history_size; - + char* mp_prompt; char* child_prompt; int buf_lines; // Buffer size (in line) @@ -161,11 +161,11 @@ static void add_string(struct menu_priv_s* priv, char* l) { priv->add_line = 0; return; } - + if(eol) { eol[0] = '\0'; add_string(priv,l); - if(eol[1]) { + if(eol[1]) { add_line(priv,eol+1); priv->add_line = 0; } else @@ -215,7 +215,7 @@ static void draw(menu_t* menu, mp_image_t* mpi) { if(mpriv->bg >= 0) menu_draw_box(mpi,mpriv->bg,mpriv->bg_alpha,0,0,mpi->w,h); - + if(!mpriv->child || !mpriv->raw_child){ char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1]; sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer); @@ -259,11 +259,11 @@ static void check_child(menu_t* menu) { r = waitpid(mpriv->child,&child_status,WNOHANG); if(r < 0){ if(errno==ECHILD){ ///exiting children get handled in mplayer.c - for(i = 0 ; i < 3 ; i++) + for(i = 0 ; i < 3 ; i++) close(mpriv->child_fd[i]); mpriv->child = 0; mpriv->prompt = mpriv->mp_prompt; - //add_line(mpriv,"Child process exited"); + //add_line(mpriv,"Child process exited"); } else mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] Waitpid error: %s.\n",strerror(errno)); } @@ -271,7 +271,7 @@ static void check_child(menu_t* menu) { mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] Select error.\n"); return; } - + w = 0; for(i = 1 ; i < 3 ; i++) { if(FD_ISSET(mpriv->child_fd[i],&rfd)){ @@ -338,7 +338,7 @@ static int run_shell_cmd(menu_t* menu, char* cmd) { static void enter_cmd(menu_t* menu) { history_t* h; char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1]; - + sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer); add_line(mpriv,input); @@ -360,7 +360,7 @@ static void enter_cmd(menu_t* menu) { mpriv->history = h; } else mpriv->history->buffer[0] = '\0'; - + mpriv->cur_history = mpriv->history; //mpriv->input = mpriv->cur_history->buffer; } @@ -477,7 +477,7 @@ static int openMenu(menu_t* menu, char* args) { mpriv->cur_history = mpriv->history = calloc(1,sizeof(history_t)); mpriv->cur_history->buffer = calloc(255,1); mpriv->cur_history->size = 255; - + if(args) add_line(mpriv,args); diff --git a/libmenu/menu_dvbin.c b/libmenu/menu_dvbin.c index 769eacf721..e2b99a0f07 100644 --- a/libmenu/menu_dvbin.c +++ b/libmenu/menu_dvbin.c @@ -120,17 +120,17 @@ static int fill_channels_menu(menu_t *menu, dvb_channels_list *dvb_list_ptr) elem->p.next = NULL; elem->p.txt = strdup(channel->name); elem->num = n; - + menu_list_add_entry(menu, elem); } else { - mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", + mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", sizeof(list_entry_t), strerror(errno)); break; } - } - + } + return n; } @@ -147,23 +147,23 @@ static int fill_cards_menu(menu_t *menu, dvb_config_t *conf) elem->p.next = NULL; elem->p.txt = strdup(conf->cards[n].name); elem->num = n; - + if(n == 0) elem->p.prev = NULL; - + menu_list_add_entry(menu, elem); } else { - fprintf(stderr, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", + fprintf(stderr, "dvb_menu: fill_menu: couldn't malloc %d bytes for menu item: %s, exit\n", sizeof(list_entry_t), strerror(errno)); if(n) return 1; return 0; } - } - + } + return n; } @@ -172,9 +172,9 @@ static int fill_menu(menu_t* menu) { list_entry_t* elem; dvb_channels_list *dvb_list_ptr; - + menu_list_init(menu); - + if(mpriv->config == NULL) { if((elem = calloc(1, sizeof(list_entry_t))) != NULL) @@ -187,7 +187,7 @@ static int fill_menu(menu_t* menu) } return 0; } - + mpriv->p.title = mpriv->title; if(mpriv->level == 1 && mpriv->config->count > 1) return fill_cards_menu(menu, mpriv->config); @@ -216,17 +216,17 @@ static void read_cmd(menu_t* menu, int cmd) mpriv->card = mpriv->p.current->num; mpriv->level = 2; menu_list_uninit(menu, free_entry); - fill_menu(menu); + fill_menu(menu); } else { dvb_priv_t *dvbp = (dvb_priv_t*) mpriv->config->priv; cmd_name = malloc(25 + strlen(elem->p.txt)); if(dvbp != NULL) - sprintf(cmd_name, "dvb_set_channel %d %d", elem->num, mpriv->card); + sprintf(cmd_name, "dvb_set_channel %d %d", elem->num, mpriv->card); else sprintf(cmd_name, "loadfile 'dvb://%d@%s'", mpriv->card+1, elem->p.txt); - + c = mp_input_parse_cmd(cmd_name); free(cmd_name); if(c) @@ -243,7 +243,7 @@ static void read_cmd(menu_t* menu, int cmd) case MENU_CMD_CANCEL: { elem = mpriv->p.current; - + menu_list_uninit(menu, free_entry); if(mpriv->config->count > 1) mpriv->level--; diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c index 8c562e0871..08507bec20 100644 --- a/libmenu/menu_filesel.c +++ b/libmenu/menu_filesel.c @@ -63,7 +63,7 @@ struct menu_priv_s { char* file_action; char* dir_action; char** actions; - char* filter; + char* filter; }; static struct menu_priv_s cfg_dflt = { @@ -103,7 +103,7 @@ static char* replace_path(char* title , char* dir , int escape) { if(p) { int tl = strlen(title); int dl = strlen(dir); - int t1l = p-title; + int t1l = p-title; int l = tl - 2 + dl; char *r, *n, *d = dir; @@ -294,7 +294,7 @@ static int open_dir(menu_t* menu,char* args) { mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] realloc error: %s\n", strerror(errno)); n--; goto bailout; - } + } namelist=tp; } @@ -304,7 +304,7 @@ static int open_dir(menu_t* menu,char* args) { n--; goto bailout; } - + strcpy(namelist[n], dp->d_name); if(S_ISDIR(st.st_mode)) strcat(namelist[n], "/"); @@ -432,7 +432,7 @@ static int open_fs(menu_t* menu, char* args) { if (!path || path[0] == '\0') { struct stat st; int path_fp; - + path_fp = open (MENU_KEEP_PATH, O_RDONLY); if (path_fp >= 0) { if (!fstat (path_fp, &st) && (st.st_size > 0)) { @@ -448,7 +448,7 @@ static int open_fs(menu_t* menu, char* args) { } } } - + getcwd(wd,PATH_MAX); if (!path || path[0] == '\0') { #if 0 @@ -494,7 +494,7 @@ static int open_fs(menu_t* menu, char* args) { return r; } - + const menu_info_t menu_info_filesel = { "File seletor menu", "filesel", diff --git a/libmenu/menu_list.c b/libmenu/menu_list.c index c896ac0afa..0fd6ffb2cf 100644 --- a/libmenu/menu_list.c +++ b/libmenu/menu_list.c @@ -87,7 +87,7 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) { if(m) mpriv->current = m; else ptr_l = 0; } - + for(i = 0, m = mpriv->menu ; m ; m = m->next, i++) { int ll; if(m->hide) continue; @@ -101,7 +101,7 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) { x += mpriv->minb; if(y > 0) y += mpriv->minb; - else + else y = mpriv->minb; need_h = count * line_h - mpriv->vspace; @@ -151,7 +151,7 @@ void menu_list_draw(menu_t* menu,mp_image_t* mpi) { MENU_TEXT_TOP|(x < 0 ? MENU_TEXT_HCENTER :MENU_TEXT_LEFT)); dy += th; } - + dx = x < 0 ? (mpi->w - need_w) / 2 : x; bx = x < 0 ? (mpi->w - bg_w) / 2 : x - mpriv->minb; @@ -273,7 +273,7 @@ void menu_list_read_cmd(menu_t* menu,int cmd) { mouse_y >= selection_y && mouse_y < selection_y + selection_h) menu_read_cmd(menu, MENU_CMD_OK); break; - } + } } int menu_list_jump_to_key(menu_t* menu,int c) { @@ -311,7 +311,7 @@ void menu_list_add_entry(menu_t* menu,list_entry_t* entry) { l->next = entry; entry->prev = l; } - + void menu_list_init(menu_t* menu) { if(!mpriv) mpriv = calloc(1,sizeof(struct menu_priv_s)); @@ -328,8 +328,7 @@ void menu_list_uninit(menu_t* menu,free_entry_t free_func) { free_func(i); i = j; } - + mpriv->menu = mpriv->current = NULL; } - diff --git a/libmenu/menu_list.h b/libmenu/menu_list.h index 44e5ed8e14..8bc78e2792 100644 --- a/libmenu/menu_list.h +++ b/libmenu/menu_list.h @@ -83,7 +83,7 @@ extern const menu_list_priv_t menu_list_priv_dflt; 0xFF, 0xFF, \ 0xA4, 0x50 \ } - + #define MENU_LIST_PRIV_FIELDS \ { "minbor", M_ST_OFF(menu_list_priv_t,minb), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, \ diff --git a/libmenu/menu_param.c b/libmenu/menu_param.c index 7e3a4f1a1c..5052a26954 100644 --- a/libmenu/menu_param.c +++ b/libmenu/menu_param.c @@ -60,7 +60,7 @@ struct menu_priv_s { char* na; int hide_na; }; - + static struct menu_priv_s cfg_dflt = { MENU_LIST_PRIV_DFLT, NULL, @@ -112,7 +112,7 @@ static int parse_args(menu_t* menu,char* args) { int r; m_option_t* opt; ASX_Parser_t* parser = asx_parser_new(menu->mconfig); - + while(1) { r = asx_get_element(parser,&args,&element,&body,&attribs); @@ -120,7 +120,7 @@ static int parse_args(menu_t* menu,char* args) { mp_tmsg(MSGT_OSD_MENU,MSGL_ERR,"[MENU] syntax error at line: %d\n",parser->line); asx_parser_free(parser); return -1; - } else if(r == 0) { + } else if(r == 0) { asx_parser_free(parser); if(!m) mp_tmsg(MSGT_OSD_MENU,MSGL_WARN,"[MENU] No entry found in the menu definition.\n"); @@ -200,7 +200,7 @@ static void read_cmd(menu_t* menu,int cmd) { if(mp_property_do(e->prop,M_PROPERTY_STEP_DOWN,NULL,menu->ctx) > 0) update_entries(menu, 0); return; - + case MENU_CMD_OK: // check that the property is writable if(mp_property_do(e->prop,M_PROPERTY_SET,NULL,menu->ctx) < 0) return; @@ -281,7 +281,7 @@ static int openMenu(menu_t* menu, char* args) { mp_tmsg(MSGT_OSD_MENU,MSGL_ERR,"[MENU] Pref menu needs an argument.\n"); return 0; } - + menu_list_init(menu); return parse_args(menu,args); } diff --git a/libmenu/menu_pt.c b/libmenu/menu_pt.c index 3378d93d64..a985b63176 100644 --- a/libmenu/menu_pt.c +++ b/libmenu/menu_pt.c @@ -44,7 +44,7 @@ struct list_entry_s { struct list_entry p; play_tree_t* pt; }; - + struct menu_priv_s { menu_list_priv_t p; @@ -132,7 +132,7 @@ static int op(menu_t* menu, char* args) { play_tree_t* i; list_entry_t* e; play_tree_iter_t* playtree_iter = mpctx_get_playtree_iter(menu->ctx); - + args = NULL; // Warning kill menu->draw = menu_list_draw; @@ -150,7 +150,7 @@ static int op(menu_t* menu, char* args) { e->pt = playtree_iter->tree->parent; menu_list_add_entry(menu,e); } - + for(i = playtree_iter->tree ; i->prev != NULL ; i = i->prev) /* NOP */; for( ; i != NULL ; i = i->next ) { diff --git a/libmenu/menu_txt.c b/libmenu/menu_txt.c index 4ce2ce487c..d7d2c874c5 100644 --- a/libmenu/menu_txt.c +++ b/libmenu/menu_txt.c @@ -119,14 +119,14 @@ static void draw(menu_t* menu,mp_image_t* mpi) { end = i + mpriv->disp_lines; if(end >= mpriv->num_lines) end = mpriv->num_lines - 1; } - + for( ; i < end ; i++) { menu_draw_text(mpi,mpriv->lines[i],x,y); y += vo_font->height + mpriv->hspace; } } - + #define BUF_SIZE 1024 static int open_txt(menu_t* menu, char* args) { @@ -164,7 +164,7 @@ static int open_txt(menu_t* menu, char* args) { } pos += r; buf[pos] = '\0'; - + while((l = strchr(buf,'\n')) != NULL) { s = l-buf; mpriv->lines = realloc(mpriv->lines,(mpriv->num_lines + 1)*sizeof(char*)); diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index 84b9197aa7..f8ceecc9ca 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -71,7 +71,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) { switch(cmd->id) { case MP_CMD_MENU : { // Convert txt cmd from the users into libmenu stuff char* arg = cmd->args[0].v.s; - + if (!priv->current->show && strcmp(arg,"hide")) priv->current->show = 1; else if(strcmp(arg,"up") == 0) @@ -132,7 +132,7 @@ static void get_image(struct vf_instance* vf, mp_image_t *mpi){ return; } } - + static int key_cb(int code) { return menu_read_key(st_priv->current,code); } @@ -214,7 +214,7 @@ static void uninit(vf_instance_t *vf) { } static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height, - unsigned int flags, unsigned int outfmt) { + unsigned int flags, unsigned int outfmt) { #ifdef CONFIG_FREETYPE // here is the right place to get screen dimensions if (force_load_font) { @@ -264,6 +264,3 @@ vf_info_t vf_info_menu = { open_vf, NULL }; - - - -- cgit v1.2.3