From: <ny...@us...> - 2006-12-27 16:38:55
|
Revision: 206 http://svn.sourceforge.net/pmplib/?rev=206&view=rev Author: nyaochi Date: 2006-12-27 08:38:53 -0800 (Wed, 27 Dec 2006) Log Message: ----------- - Trivial comments. - Reduce some warnings with MSVC2005. Modified Paths: -------------- trunk/pmplib/frontend/easypmp/cui/main.c trunk/pmplib/frontend/easypmp/cui/option.c trunk/pmplib/include/os.h trunk/pmplib/lib/gmi/gmi_vorbis.c trunk/pmplib/lib/pmp_iriverplus3/dat.c trunk/pmplib/lib/pmp_iriverplus3/ip3db.c trunk/pmplib/lib/pmp_iriverplus3/ip3db.h Modified: trunk/pmplib/frontend/easypmp/cui/main.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/main.c 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/frontend/easypmp/cui/main.c 2006-12-27 16:38:53 UTC (rev 206) @@ -25,14 +25,14 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ -#ifdef HAVE_STRING_H -#include <string.h> -#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> #include <stdlib.h> #include <locale.h> +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #ifdef _MSC_VER #include <direct.h> /* getcwd() */ #endif/*_MSC_VER*/ Modified: trunk/pmplib/frontend/easypmp/cui/option.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/option.c 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/frontend/easypmp/cui/option.c 2006-12-27 16:38:53 UTC (rev 206) @@ -25,13 +25,13 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ -#ifdef HAVE_STRING_H -#include <string.h> -#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> #include <stdlib.h> +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #ifdef _MSC_VER #include <direct.h> /* getcwd() */ #endif/*_MSC_VER*/ Modified: trunk/pmplib/include/os.h =================================================================== --- trunk/pmplib/include/os.h 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/include/os.h 2006-12-27 16:38:53 UTC (rev 206) @@ -24,6 +24,14 @@ #ifndef __OS_H__ #define __OS_H__ +#ifdef _MSC_VER +#define HAVE_STRING_H 1 +#endif/*_MSC_VER*/ + +#if _MSC_VER >= 1400 +#define _CRT_SECURE_NO_DEPRECATE 1 /* Use 'unsafe' CRT routines. */ +#endif/*_MSC_VER*/ + #include <stdio.h> #if defined(WIN32) || defined(OS2) @@ -45,8 +53,11 @@ #endif #if defined(WIN32) +#define fileno _fileno +#define strnicmp _strnicmp #define snprintf _snprintf #define snwprintf _snwprintf +#define strdup _strdup #define getcwd _getcwd #define alloca _alloca #define strnicmp _strnicmp Modified: trunk/pmplib/lib/gmi/gmi_vorbis.c =================================================================== --- trunk/pmplib/lib/gmi/gmi_vorbis.c 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/lib/gmi/gmi_vorbis.c 2006-12-27 16:38:53 UTC (rev 206) @@ -43,7 +43,7 @@ */ #ifdef WIN32 -#define strncasecmp strnicmp +#define strncasecmp _strnicmp #endif int gmi_vorbis(media_info_t* info, const ucs2char_t *filename) Modified: trunk/pmplib/lib/pmp_iriverplus3/dat.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/dat.c 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/lib/pmp_iriverplus3/dat.c 2006-12-27 16:38:53 UTC (rev 206) @@ -274,6 +274,11 @@ fprintf(fp, "}\n"); } +typedef struct { + const ip3db_music_record_t* base; + int index; +} ip3db_sort_index_t; + static int comp_pathname(const void *__x, const void *__y) { const ip3db_sort_index_t* _x = (const ip3db_sort_index_t*)__x; Modified: trunk/pmplib/lib/pmp_iriverplus3/ip3db.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/ip3db.c 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/lib/pmp_iriverplus3/ip3db.c 2006-12-27 16:38:53 UTC (rev 206) @@ -42,6 +42,9 @@ var->type = type; if (var->type == IP3DBVT_STRING) { var->value.str = mbsdupucs2(""); + if (!var->value.str) { + var->type = IP3DBVT_NONE; + } } } Modified: trunk/pmplib/lib/pmp_iriverplus3/ip3db.h =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/ip3db.h 2006-12-27 14:50:16 UTC (rev 205) +++ trunk/pmplib/lib/pmp_iriverplus3/ip3db.h 2006-12-27 16:38:53 UTC (rev 206) @@ -25,18 +25,18 @@ #define __IP3DB_IP3DB_H__ enum { - IP3DBIDX_MAX_KEYLEVEL = 3, + IP3DBIDX_MAX_KEYLEVEL = 3, /**< The maximum number of multiple AVL trees. */ }; /** * Field type IDs used in db.dic (Do not change the associated values) */ enum { - IP3DBVT_NONE = 0, - IP3DBVT_STRING = 1, - IP3DBVT_BYTE = 2, - IP3DBVT_WORD = 3, - IP3DBVT_DWORD = 4, + IP3DBVT_NONE = 0, /**< Attached to no specific type. */ + IP3DBVT_STRING = 1, /**< UCS-2 string. */ + IP3DBVT_BYTE = 2, /**< uint8_t */ + IP3DBVT_WORD = 3, /**< uint16_t */ + IP3DBVT_DWORD = 4, /**< uint32_t */ }; /** @@ -52,6 +52,9 @@ } value; } ip3db_variant_t; +/** + * Fields in a music record. + */ enum { IP3DBF_MUSIC_NONE = -1, IP3DBF_MUSIC_BEGIN = 0, @@ -84,14 +87,11 @@ IP3DBF_MUSIC_LAST, }; +/** + * A music record. + */ typedef ip3db_variant_t ip3db_music_record_t[IP3DBF_MUSIC_LAST]; -typedef struct { - const ip3db_music_record_t* base; - int index; -} ip3db_sort_index_t; - - enum { IP3DBF_OBJECTS_NONE = -1, IP3DBF_OBJECTS_BEGIN = 0, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |