From: <ny...@us...> - 2007-02-10 18:39:35
|
Revision: 331 http://svn.sourceforge.net/pmplib/?rev=331&view=rev Author: nyaochi Date: 2007-02-10 10:39:35 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Reduced warnings. Modified Paths: -------------- trunk/pmplib/include/pmplib/os_types.h trunk/pmplib/lib/filepath/filepath_posix.c trunk/pmplib/lib/pmp/pmp_posix.c trunk/pmplib/lib/pmp_iriverplus3/idx.c trunk/pmplib/lib/pmp_iriverplus3/ip3db.c trunk/pmplib/lib/pmp_iriverplus3/ip3db.h trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c Modified: trunk/pmplib/include/pmplib/os_types.h =================================================================== --- trunk/pmplib/include/pmplib/os_types.h 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/include/pmplib/os_types.h 2007-02-10 18:39:35 UTC (rev 331) @@ -24,7 +24,7 @@ #ifndef __OS_TYPES_H__ #define __OS_TYPES_H__ -#if defined(__GNU_C__) +#if defined(__GNUC__) #include <inttypes.h> #elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) Modified: trunk/pmplib/lib/filepath/filepath_posix.c =================================================================== --- trunk/pmplib/lib/filepath/filepath_posix.c 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/lib/filepath/filepath_posix.c 2007-02-10 18:39:35 UTC (rev 331) @@ -37,6 +37,17 @@ #include <pmplib/filepath.h> #include "rel2abs.h" +static int _decode(char* path) +{ + while (*path) { + if (*path == 0x5C) { + *path = 0x2F; + } + path++; + } + return 0; +} + int find_file(const ucs2char_t* path, int recursive, filepath_findfile_callback callback, void *instance) { DIR *dirp = NULL; @@ -272,7 +283,7 @@ char *mbs_path = ucs2dupmbs(filename); if (mbs_path) { - filepath_decode(mbs_path); + _decode(mbs_path); //fprintf(stderr, "is_exist: %s\n", mbs_path); ret = open(mbs_path, 0); free(mbs_path); @@ -372,7 +383,7 @@ char *mbs_path = ucs2dupmbs(filename); if (mbs_path) { - filepath_decode(mbs_path); + _decode(mbs_path); ret = stat(mbs_path, &st); free(mbs_path); if (ret == 0) { @@ -389,7 +400,7 @@ char *mbs_path = ucs2dupmbs(filename); if (mbs_path) { - filepath_decode(mbs_path); + _decode(mbs_path); ret = stat(mbs_path, &st); free(mbs_path); if (ret == 0) { @@ -406,7 +417,7 @@ char *mbs_path = ucs2dupmbs(filename); if (mbs_path) { - filepath_decode(mbs_path); + _decode(mbs_path); ret = stat(mbs_path, &st); free(mbs_path); if (ret == 0) { Modified: trunk/pmplib/lib/pmp/pmp_posix.c =================================================================== --- trunk/pmplib/lib/pmp/pmp_posix.c 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/lib/pmp/pmp_posix.c 2007-02-10 18:39:35 UTC (rev 331) @@ -129,14 +129,14 @@ result_t pmplib_create(pmplib_t* pmplib, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) { - result_t ret = PMP_DEVICENOTFOUND; + result_t ret = PMPERR_DEVICENOTFOUND; uint32_t i; for (i = 0;i < pmplib->num_plugins;++i) { pmplib_create_t func = (pmplib_create_t)lt_dlsym(pmplib->plugins[i], "pmp_create"); if (func) { ret = func(pmp, path_to_device, id); - if (ret != PMP_DEVICENOTFOUND) { + if (ret != PMPERR_DEVICENOTFOUND) { return ret; } } Modified: trunk/pmplib/lib/pmp_iriverplus3/idx.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/idx.c 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/lib/pmp_iriverplus3/idx.c 2007-02-10 18:39:35 UTC (rev 331) @@ -735,9 +735,11 @@ { int i; uint32_t offset = 0; + long size = 0; /* Read the whole data at a time. */ - fread_all(fpi, &idx->avl->buffer, &idx->avl->size); + fread_all(fpi, &idx->avl->buffer, &size); + idx->avl->size = size; /* Convert the byte order of the header from big endian to the native one. */ while (offset < idx->avl->size) { Modified: trunk/pmplib/lib/pmp_iriverplus3/ip3db.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/ip3db.c 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/lib/pmp_iriverplus3/ip3db.c 2007-02-10 18:39:35 UTC (rev 331) @@ -214,7 +214,7 @@ return 0; } -result_t ip3db_set(ip3db_t* db, const ip3db_music_record_t* records, int num_records, const ip3db_playlist_t* playlists, int num_playlists) +result_t ip3db_set(ip3db_t* db, const ip3db_music_record_t* records, int num_records, ip3db_playlist_t* playlists, int num_playlists) { /* Construct records in db->dat from the records. */ dat_set(db->dat, db->dic, records, num_records, playlists, num_playlists); Modified: trunk/pmplib/lib/pmp_iriverplus3/ip3db.h =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/ip3db.h 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/lib/pmp_iriverplus3/ip3db.h 2007-02-10 18:39:35 UTC (rev 331) @@ -206,7 +206,7 @@ void ip3db_finish(ip3db_t* db); result_t ip3db_read(ip3db_t* db, const ucs2char_t* datfn, const ucs2char_t* dicfn, const ucs2char_t* idxfn); result_t ip3db_write(ip3db_t* db, const ucs2char_t* datfn, const ucs2char_t* dicfn, const ucs2char_t* idxfn); -result_t ip3db_set(ip3db_t* db, const ip3db_music_record_t* records, int num_records, const ip3db_playlist_t* playlists, int num_playlists); +result_t ip3db_set(ip3db_t* db, const ip3db_music_record_t* records, int num_records, ip3db_playlist_t* playlists, int num_playlists); int ip3db_num_records(ip3db_t* db); ip3db_music_record_t* ip3db_get_record(ip3db_t* db, int i); result_t ip3db_dump(ip3db_t* db, FILE *fpo); Modified: trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-02-10 18:03:21 UTC (rev 330) +++ trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-02-10 18:39:35 UTC (rev 331) @@ -605,9 +605,21 @@ // Register records (and playlists) to the database. if (pmp->flag & PMPOF_MUSIC_PL_WRITE) { - ip3db_set(&pmpmi->ip3db, records, pmpmi->num_records, pmpmi->playlists, pmpmi->num_playlists); + ip3db_set( + &pmpmi->ip3db, + (const ip3db_music_record_t*)records, + pmpmi->num_records, + pmpmi->playlists, + pmpmi->num_playlists + ); } else { - ip3db_set(&pmpmi->ip3db, records, pmpmi->num_records, NULL, 0); + ip3db_set( + &pmpmi->ip3db, + (const ip3db_music_record_t*)records, + pmpmi->num_records, + NULL, + 0 + ); } // Write out the music database. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |