From: Darren S. <ds...@us...> - 2006-07-15 22:18:40
|
Update of /cvsroot/xine/xine-ui/src/xitk In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9911/src/xitk Modified Files: kbindings.c Log Message: Collapse some multiple fprintf()s and multiple strlcat()s. Index: kbindings.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/kbindings.c,v retrieving revision 1.131 retrieving revision 1.132 diff -u -r1.131 -r1.132 --- kbindings.c 15 Jul 2006 20:26:20 -0000 1.131 +++ kbindings.c 15 Jul 2006 22:18:36 -0000 1.132 @@ -1012,17 +1012,17 @@ switch(mode) { case LIRC_DISPLAY_MODE: - fprintf(stream, "##\n# xine key bindings.\n"); - fprintf(stream, "# Automatically generated by %s version %s.\n##\n\n", PACKAGE, VERSION); + fprintf(stream, "##\n# xine key bindings.\n" + "# Automatically generated by %s version %s.\n##\n\n", PACKAGE, VERSION); for(k = kbt->entry, i = 0; k[i]->action != NULL; i++) { if(!k[i]->is_alias) { snprintf(buf, sizeof(buf), "# %s\n", k[i]->comment); - strlcat(buf, "begin\n", sizeof(buf)); - strlcat(buf, "\tremote = xxxxx\n", sizeof(buf)); - strlcat(buf, "\tbutton = xxxxx\n", sizeof(buf)); - strlcat(buf, "\tprog = xine\n", sizeof(buf)); - strlcat(buf, "\trepeat = 0\n", sizeof(buf)); + strlcat(buf, "begin\n" + "\tremote = xxxxx\n" + "\tbutton = xxxxx\n" + "\tprog = xine\n" + "\trepeat = 0\n", sizeof(buf)); snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\tconfig = %s\n", k[i]->action); strlcat(buf, "end\n\n", sizeof(buf)); fputs(buf, stream); @@ -1033,21 +1033,19 @@ case DEFAULT_DISPLAY_MODE: default: - fprintf(stream, "##\n# xine key bindings.\n"); - fprintf(stream, "# Automatically generated by %s version %s.\n##\n\n", PACKAGE, VERSION); + fprintf(stream, "##\n# xine key bindings.\n" + "# Automatically generated by %s version %s.\n##\n\n", PACKAGE, VERSION); for(k = kbt->entry, i = 0; k[i]->action != NULL; i++) { snprintf(buf, sizeof(buf), "# %s\n", k[i]->comment); if(k[i]->is_alias) { - strlcat(buf, "Alias {\n", sizeof(buf)); - sprintf(buf+strlen(buf), "\tentry = %s\n", k[i]->action); + sprintf(buf+strlen(buf), "Alias {\n\tentry = %s\n", k[i]->action); } else sprintf(buf+strlen(buf), "%s {\n", k[i]->action); - sprintf(buf+strlen(buf), "\tkey = %s\n", k[i]->key); - strlcat(buf, "\tmodifier = ", sizeof(buf)); + sprintf(buf+strlen(buf), "\tkey = %s\n\tmodifier = ", k[i]->key); if(k[i]->modifier == KEYMOD_NOMOD) strlcat(buf, "none, ", sizeof(buf)); if(k[i]->modifier & KEYMOD_CONTROL) |