[Toxine-cvs] CVS: toxine/src commands.c,1.65,1.66 loader.c,1.18,1.19 main.c,1.31,1.32 parse.c,1.7,1.
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2004-05-17 20:32:05
|
Update of /cvsroot/toxine/toxine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25018 Modified Files: commands.c loader.c main.c parse.c playlist.c script.c utils.c Log Message: Remove declaration of errno type. Remove malloc/realloc couple, only use realloc. Remove forgotten debug printf. Index: commands.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/commands.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- commands.c 17 May 2004 20:04:16 -0000 1.65 +++ commands.c 17 May 2004 20:31:42 -0000 1.66 @@ -44,8 +44,6 @@ #include "script.h" #include "playlist.h" -extern int errno; - static struct event_struct_s { char *name; uint32_t event; @@ -1770,7 +1768,6 @@ tox->playlist.loop = 0; if(tox->playlist.num && (tox->playlist.cur == -1)) { - printf("tox->playlist.num && (tox->playlist.cur == -1)\n"); tox->playlist.cur = 0; toxine_set_current_mrl_from_cur(tox); } Index: loader.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/loader.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- loader.c 17 May 2004 20:15:52 -0000 1.18 +++ loader.c 17 May 2004 20:31:43 -0000 1.19 @@ -33,8 +33,6 @@ #include "common.h" -extern int errno; - #ifdef LOCAL_BUILD #warning "Load plugins from plugins/.libs" #undef TOXINE_PLUGINDIR Index: main.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/main.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- main.c 17 May 2004 20:08:28 -0000 1.31 +++ main.c 17 May 2004 20:31:43 -0000 1.32 @@ -50,8 +50,6 @@ #include "commands.h" #include "playlist.h" -extern int errno; - static toxine_t *tox; /* options args */ Index: parse.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/parse.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- parse.c 16 May 2004 20:28:40 -0000 1.7 +++ parse.c 17 May 2004 20:31:43 -0000 1.8 @@ -86,11 +86,7 @@ if(p) sprintf(remaining, "%s", (toxine_atoa(p))); - if(tox->command.line) - tox->command.line = (char *) realloc(tox->command.line, - sizeof(char *) * (strlen(c) + 1)); - else - tox->command.line = (char *) xine_xmalloc(sizeof(char *) * (strlen(c) + 1)); + tox->command.line = (char *) realloc(tox->command.line, sizeof(char *) * (strlen(c) + 1)); sprintf(tox->command.line, "%s", c); @@ -105,8 +101,7 @@ } if(strlen(remaining)) { - tox->command.remain = (char *) realloc(tox->command.remain, - sizeof(char *) * (strlen(remaining) + 1)); + tox->command.remain = (char *) realloc(tox->command.remain, sizeof(char *) * (strlen(remaining) + 1)); sprintf(tox->command.remain, "%s", remaining); } else { @@ -120,13 +115,7 @@ } else { /* no ';' in remain, copy AS IS remain to line */ - if(tox->command.line) - tox->command.line = (char *) realloc(tox->command.line, - sizeof(char *) * (strlen(tox->command.remain) + 1)); - else - tox->command.line = (char *) xine_xmalloc(sizeof(char *) * - (strlen(tox->command.remain) + 1)); - + tox->command.line = (char *) realloc(tox->command.line, sizeof(char *) * (strlen(tox->command.remain) + 1)); sprintf(tox->command.line, "%s", tox->command.remain); toxine_free(tox->command.remain); @@ -180,12 +169,8 @@ cmd = NULL; if(cmd) { - if(tox->command.command) - tox->command.command = (char *) realloc(tox->command.command, - strlen(cmdl) - strlen(cmd) + 1); - else - tox->command.command = (char *) xine_xmalloc(strlen(cmdl) - strlen(cmd) + 1); - + tox->command.command = (char *) realloc(tox->command.command, strlen(cmdl) - strlen(cmd) + 1); + memset(tox->command.command, 0, sizeof(tox->command.command)); snprintf(tox->command.command, (strlen(cmdl) - strlen(cmd))+1, "%s", cmdl); @@ -303,12 +288,8 @@ } } else { - - if(tox->command.command) - tox->command.command = (char *) realloc(tox->command.command, strlen(cmdl) + 1); - else - tox->command.command = (char *) xine_xmalloc(strlen(cmdl) + 1); - + tox->command.command = (char *) realloc(tox->command.command, strlen(cmdl) + 1); + memset(tox->command.command, 0, sizeof(tox->command.command)); sprintf(tox->command.command, "%s", cmdl); } Index: playlist.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/playlist.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- playlist.c 7 Apr 2004 18:21:07 -0000 1.12 +++ playlist.c 17 May 2004 20:31:43 -0000 1.13 @@ -16,6 +16,7 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ +#warning Backport xine-ui playlists #ifdef HAVE_CONFIG_H #include "config.h" @@ -33,8 +34,6 @@ #include "common.h" #include "utils.h" -extern int errno; - typedef struct { FILE *fd; char buf[256]; @@ -228,10 +227,7 @@ if(valid_pls) { entries_pls++; - if(entries_pls == 1) - mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else - mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); _playlist_store_mmk(&mmk[(entries_pls - 1)], playlist->ln, NULL, 0, -1); playlist->entries = entries_pls; @@ -286,10 +282,7 @@ entries_pls++; - if(entries_pls == 1) - mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else - mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); _playlist_store_mmk(&mmk[(entries_pls - 1)], playlist->ln, NULL, 0, -1); playlist->entries = entries_pls; @@ -345,10 +338,7 @@ entries_pls++; - if(entries_pls == 1) - mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else - mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); _playlist_store_mmk(&mmk[(entries_pls - 1)], entry, NULL, 0, -1); playlist->entries = entries_pls; @@ -411,10 +401,7 @@ entries_pls++; - if(entries_pls == 1) - mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else - mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); _playlist_store_mmk(&mmk[(entries_pls - 1)], playlist->ln, NULL, 0, -1); playlist->entries = entries_pls; @@ -551,10 +538,7 @@ entries_pls++; - if(entries_pls == 1) - mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else - mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); + mmk = (mediamark_t **) realloc(mmk, sizeof(mediamark_t *) * (entries_pls + 1)); _playlist_store_mmk(&mmk[(entries_pls - 1)], mmkf.mrl, mmkf.ident, mmkf.start, mmkf.end); @@ -612,15 +596,19 @@ } void playlist_add_entry(toxine_t *tox, const char *mrl, const char *ident, int start, int end) { - if(!tox->playlist.num) +#warning FIXME + /* + if(!tox->playlist.num) tox->playlist.mmk = (mediamark_t **) xine_xmalloc(sizeof(mediamark_t *) * 2); - else { + else { if(tox->playlist.num > 1) { - tox->playlist.mmk = (mediamark_t **) - realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 1)); - } - } + */ + tox->playlist.mmk = (mediamark_t **) realloc(tox->playlist.mmk, sizeof(mediamark_t *) * (tox->playlist.num + 1)); + /* + } + } + */ if(_playlist_store_mmk(&tox->playlist.mmk[tox->playlist.num], mrl, ident, start, end)) tox->playlist.num++; } Index: script.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/script.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- script.c 7 Apr 2004 18:21:07 -0000 1.3 +++ script.c 17 May 2004 20:31:43 -0000 1.4 @@ -26,8 +26,6 @@ #include "commands.h" #include "utils.h" -extern int errno; - /* * Cleanup the EOL ('\n','\r',' ') */ Index: utils.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/utils.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- utils.c 17 May 2004 19:53:25 -0000 1.27 +++ utils.c 17 May 2004 20:31:43 -0000 1.28 @@ -34,7 +34,6 @@ #include "tilde.h" extern char **environ; -extern int errno; #include "common.h" #include "playlist.h" @@ -270,11 +269,7 @@ if(tox && line && strlen(line)) { - if(tox->command.line) - tox->command.line = (char *) realloc(tox->command.line, strlen(line) + 1); - else - tox->command.line = (char *) xine_xmalloc(strlen(line) + 1); - + tox->command.line = (char *) realloc(tox->command.line, strlen(line) + 1); memset(tox->command.line, 0, sizeof(tox->command.line)); sprintf(tox->command.line, "%s", line); @@ -441,11 +436,7 @@ void toxine_set_last_char_result(toxine_t *tox, const char *result) { if(tox) { if(result) { - if(tox->last_result) - tox->last_result = (char *) realloc(tox->last_result, (strlen(result) + 1)); - else - tox->last_result = (char *) xine_xmalloc(strlen(result) + 1); - + tox->last_result = (char *) realloc(tox->last_result, (strlen(result) + 1)); memset(tox->last_result, 0, sizeof(tox->last_result)); sprintf(tox->last_result, "%s", result); } @@ -467,11 +458,7 @@ len += ((2 * (i - 1)) + 1); - if(tox->last_result) - tox->last_result = (char *) realloc(tox->last_result, (len + 1)); - else - tox->last_result = (char *) xine_xmalloc(len + 1); - + tox->last_result = (char *) realloc(tox->last_result, (len + 1)); memset(tox->last_result, 0, sizeof(tox->last_result)); i = 0; |