libeplayer3-arm: eliminate some warnings

This commit is contained in:
max_10
2018-01-17 20:26:54 +01:00
committed by Thilo Graf
parent c5dc767b64
commit 5ccdc663b2
5 changed files with 42 additions and 50 deletions

View File

@@ -61,8 +61,6 @@ if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x)
#define cERR_AUDIO_MGR_NO_ERROR 0 #define cERR_AUDIO_MGR_NO_ERROR 0
#define cERR_AUDIO_MGR_ERROR -1 #define cERR_AUDIO_MGR_ERROR -1
static const char FILENAME[] = __FILE__;
/* ***************************** */ /* ***************************** */
/* Types */ /* Types */
/* ***************************** */ /* ***************************** */
@@ -85,7 +83,7 @@ static int CurrentTrack = 0; //TRACK[0] as default.
static int ManagerAdd(Context_t *context, Track_t track) static int ManagerAdd(Context_t *context, Track_t track)
{ {
audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", FILENAME, __FUNCTION__, track.Name, track.Encoding, track.Id); audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", __FILE__, __FUNCTION__, track.Name, track.Encoding, track.Id);
if (Tracks == NULL) if (Tracks == NULL)
{ {
Tracks = malloc(sizeof(Track_t) * TRACKWRAP); Tracks = malloc(sizeof(Track_t) * TRACKWRAP);
@@ -97,7 +95,7 @@ static int ManagerAdd(Context_t *context, Track_t track)
} }
if (Tracks == NULL) if (Tracks == NULL)
{ {
audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); audio_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__);
return cERR_AUDIO_MGR_ERROR; return cERR_AUDIO_MGR_ERROR;
} }
int i = 0; int i = 0;
@@ -116,14 +114,14 @@ static int ManagerAdd(Context_t *context, Track_t track)
} }
else else
{ {
audio_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, TrackCount, TRACKWRAP); audio_mgr_err("%s:%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP);
return cERR_AUDIO_MGR_ERROR; return cERR_AUDIO_MGR_ERROR;
} }
if (TrackCount > 0) if (TrackCount > 0)
{ {
context->playback->isAudio = 1; context->playback->isAudio = 1;
} }
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
return cERR_AUDIO_MGR_NO_ERROR; return cERR_AUDIO_MGR_NO_ERROR;
} }
@@ -131,13 +129,13 @@ static char **ManagerList(Context_t *context __attribute__((unused)))
{ {
int i = 0, j = 0; int i = 0, j = 0;
char **tracklist = NULL; char **tracklist = NULL;
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (Tracks != NULL) if (Tracks != NULL)
{ {
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
if (tracklist == NULL) if (tracklist == NULL)
{ {
audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); audio_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__);
return NULL; return NULL;
} }
for (i = 0, j = 0; i < TrackCount; i++, j += 2) for (i = 0, j = 0; i < TrackCount; i++, j += 2)
@@ -152,7 +150,7 @@ static char **ManagerList(Context_t *context __attribute__((unused)))
} }
tracklist[j] = NULL; tracklist[j] = NULL;
} }
audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount);
return tracklist; return tracklist;
} }
@@ -161,13 +159,13 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused
{ {
int i = 0; int i = 0;
TrackDescription_t *tracklist = NULL; TrackDescription_t *tracklist = NULL;
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (Tracks != NULL) if (Tracks != NULL)
{ {
tracklist = malloc(sizeof(TrackDescription_t) * ((TrackCount) + 1)); tracklist = malloc(sizeof(TrackDescription_t) * ((TrackCount) + 1));
if (tracklist == NULL) if (tracklist == NULL)
{ {
audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); audio_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__);
return NULL; return NULL;
} }
int j = 0; int j = 0;
@@ -184,7 +182,7 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused
} }
tracklist[j].Id = -1; tracklist[j].Id = -1;
} }
//audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); //audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount);
return tracklist; return tracklist;
} }
#endif #endif
@@ -192,7 +190,7 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused
static int ManagerDel(Context_t *context) static int ManagerDel(Context_t *context)
{ {
int i = 0; int i = 0;
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (Tracks != NULL) if (Tracks != NULL)
{ {
for (i = 0; i < TrackCount; i++) for (i = 0; i < TrackCount; i++)
@@ -204,13 +202,13 @@ static int ManagerDel(Context_t *context)
} }
else else
{ {
audio_mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__); audio_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__);
return cERR_AUDIO_MGR_ERROR; return cERR_AUDIO_MGR_ERROR;
} }
TrackCount = 0; TrackCount = 0;
CurrentTrack = 0; CurrentTrack = 0;
context->playback->isAudio = 0; context->playback->isAudio = 0;
audio_mgr_printf(10, "%s::%s return no error\n", FILENAME, __FUNCTION__); audio_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__);
return cERR_AUDIO_MGR_NO_ERROR; return cERR_AUDIO_MGR_NO_ERROR;
} }
@@ -218,7 +216,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
{ {
Context_t *context = (Context_t *) _context; Context_t *context = (Context_t *) _context;
int ret = cERR_AUDIO_MGR_NO_ERROR; int ret = cERR_AUDIO_MGR_NO_ERROR;
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); audio_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
switch (command) switch (command)
{ {
case MANAGER_ADD: case MANAGER_ADD:
@@ -235,7 +233,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
} }
case MANAGER_GET: case MANAGER_GET:
{ {
audio_mgr_printf(20, "%s::%s MANAGER_GET\n", FILENAME, __FUNCTION__); audio_mgr_printf(20, "%s::%s MANAGER_GET\n", __FILE__, __FUNCTION__);
if ((TrackCount > 0) && (CurrentTrack >= 0)) if ((TrackCount > 0) && (CurrentTrack >= 0))
{ {
*((int *)argument) = (int)Tracks[CurrentTrack].Id; *((int *)argument) = (int)Tracks[CurrentTrack].Id;
@@ -268,7 +266,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
} }
case MANAGER_GET_TRACK: case MANAGER_GET_TRACK:
{ {
audio_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); audio_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__);
if ((TrackCount > 0) && (CurrentTrack >= 0)) if ((TrackCount > 0) && (CurrentTrack >= 0))
{ {
*((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack];
@@ -306,7 +304,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
case MANAGER_SET: case MANAGER_SET:
{ {
int i; int i;
audio_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, *((int *)argument)); audio_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", __FILE__, __FUNCTION__, *((int *)argument));
for (i = 0; i < TrackCount; i++) for (i = 0; i < TrackCount; i++)
{ {
if (Tracks[i].Id == *((int *)argument)) if (Tracks[i].Id == *((int *)argument))
@@ -317,7 +315,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
} }
if (i == TrackCount) if (i == TrackCount)
{ {
audio_mgr_err("%s::%s track id %d unknown\n", FILENAME, __FUNCTION__, *((int *)argument)); audio_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument));
ret = cERR_AUDIO_MGR_ERROR; ret = cERR_AUDIO_MGR_ERROR;
} }
break; break;
@@ -337,11 +335,11 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
break; break;
} }
default: default:
audio_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); audio_mgr_err("%s::%s ContainerCmd %d not supported!\n", __FILE__, __FUNCTION__, command);
ret = cERR_AUDIO_MGR_ERROR; ret = cERR_AUDIO_MGR_ERROR;
break; break;
} }
audio_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret); audio_mgr_printf(10, "%s:%s: returning %d\n", __FILE__, __FUNCTION__, ret);
return ret; return ret;
} }

View File

@@ -59,8 +59,6 @@ if (debug_level >= level) printf(x); } while (0)
#define cERR_VIDEO_MGR_NO_ERROR 0 #define cERR_VIDEO_MGR_NO_ERROR 0
#define cERR_VIDEO_MGR_ERROR -1 #define cERR_VIDEO_MGR_ERROR -1
static const char FILENAME[] = __FILE__;
/* ***************************** */ /* ***************************** */
/* Types */ /* Types */
/* ***************************** */ /* ***************************** */
@@ -85,7 +83,7 @@ static void (* updatedTrackInfoFnc)(void) = NULL;
static int ManagerAdd(Context_t *context, Track_t track) static int ManagerAdd(Context_t *context, Track_t track)
{ {
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (Tracks == NULL) if (Tracks == NULL)
{ {
Tracks = malloc(sizeof(Track_t) * TRACKWRAP); Tracks = malloc(sizeof(Track_t) * TRACKWRAP);
@@ -97,7 +95,7 @@ static int ManagerAdd(Context_t *context, Track_t track)
} }
if (Tracks == NULL) if (Tracks == NULL)
{ {
video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); video_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__);
return cERR_VIDEO_MGR_ERROR; return cERR_VIDEO_MGR_ERROR;
} }
int i; int i;
@@ -116,14 +114,14 @@ static int ManagerAdd(Context_t *context, Track_t track)
} }
else else
{ {
video_mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, TrackCount, TRACKWRAP); video_mgr_err("%s:%s TrackCount out if range %d - %d\n", __FILE__, __FUNCTION__, TrackCount, TRACKWRAP);
return cERR_VIDEO_MGR_ERROR; return cERR_VIDEO_MGR_ERROR;
} }
if (TrackCount > 0) if (TrackCount > 0)
{ {
context->playback->isVideo = 1; context->playback->isVideo = 1;
} }
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
return cERR_VIDEO_MGR_NO_ERROR; return cERR_VIDEO_MGR_NO_ERROR;
} }
@@ -131,13 +129,13 @@ static char **ManagerList(Context_t *context __attribute__((unused)))
{ {
int i = 0, j = 0; int i = 0, j = 0;
char **tracklist = NULL; char **tracklist = NULL;
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (Tracks != NULL) if (Tracks != NULL)
{ {
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
if (tracklist == NULL) if (tracklist == NULL)
{ {
video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); video_mgr_err("%s:%s malloc failed\n", __FILE__, __FUNCTION__);
return NULL; return NULL;
} }
for (i = 0, j = 0; i < TrackCount; i++, j += 2) for (i = 0, j = 0; i < TrackCount; i++, j += 2)
@@ -154,14 +152,14 @@ static char **ManagerList(Context_t *context __attribute__((unused)))
} }
tracklist[j] = NULL; tracklist[j] = NULL;
} }
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount); video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", __FILE__, __FUNCTION__, tracklist, j, TrackCount);
return tracklist; return tracklist;
} }
static int ManagerDel(Context_t *context) static int ManagerDel(Context_t *context)
{ {
int i = 0; int i = 0;
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (Tracks != NULL) if (Tracks != NULL)
{ {
for (i = 0; i < TrackCount; i++) for (i = 0; i < TrackCount; i++)
@@ -173,13 +171,13 @@ static int ManagerDel(Context_t *context)
} }
else else
{ {
video_mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__); video_mgr_err("%s::%s nothing to delete!\n", __FILE__, __FUNCTION__);
return cERR_VIDEO_MGR_ERROR; return cERR_VIDEO_MGR_ERROR;
} }
TrackCount = 0; TrackCount = 0;
CurrentTrack = 0; CurrentTrack = 0;
context->playback->isVideo = 0; context->playback->isVideo = 0;
video_mgr_printf(10, "%s::%s return no error\n", FILENAME, __FUNCTION__); video_mgr_printf(10, "%s::%s return no error\n", __FILE__, __FUNCTION__);
return cERR_VIDEO_MGR_NO_ERROR; return cERR_VIDEO_MGR_NO_ERROR;
} }
@@ -187,7 +185,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
{ {
Context_t *context = (Context_t *) _context; Context_t *context = (Context_t *) _context;
int ret = cERR_VIDEO_MGR_NO_ERROR; int ret = cERR_VIDEO_MGR_NO_ERROR;
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); video_mgr_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
switch (command) switch (command)
{ {
case MANAGER_ADD: case MANAGER_ADD:
@@ -242,7 +240,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
} }
case MANAGER_GET_TRACK: case MANAGER_GET_TRACK:
{ {
video_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); video_mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", __FILE__, __FUNCTION__);
if ((TrackCount > 0) && (CurrentTrack >= 0)) if ((TrackCount > 0) && (CurrentTrack >= 0))
{ {
*((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack]; *((Track_t **)argument) = (Track_t *) &Tracks[CurrentTrack];
@@ -290,7 +288,7 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
} }
if (i == TrackCount) if (i == TrackCount)
{ {
video_mgr_err("%s::%s track id %d unknown\n", FILENAME, __FUNCTION__, *((int *)argument)); video_mgr_err("%s::%s track id %d unknown\n", __FILE__, __FUNCTION__, *((int *)argument));
ret = cERR_VIDEO_MGR_ERROR; ret = cERR_VIDEO_MGR_ERROR;
} }
break; break;
@@ -321,11 +319,11 @@ static int Command(void *_context, ManagerCmd_t command, void *argument)
break; break;
} }
default: default:
video_mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); video_mgr_err("%s::%s ContainerCmd %d not supported!\n", __FILE__, __FUNCTION__, command);
ret = cERR_VIDEO_MGR_ERROR; ret = cERR_VIDEO_MGR_ERROR;
break; break;
} }
video_mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret); video_mgr_printf(10, "%s:%s: returning %d\n", __FILE__, __FUNCTION__, ret);
return ret; return ret;
} }

View File

@@ -58,7 +58,7 @@
#define LINUXDVB_SILENT #define LINUXDVB_SILENT
#endif #endif
static short debug_level = 20; static unsigned short debug_level = 20;
static const char FILENAME[] = __FILE__; static const char FILENAME[] = __FILE__;

View File

@@ -57,8 +57,6 @@ if (debug_level >= level) fprintf(stderr, x); } while (0)
#define cERR_OUTPUT_NO_ERROR 0 #define cERR_OUTPUT_NO_ERROR 0
#define cERR_OUTPUT_INTERNAL_ERROR -1 #define cERR_OUTPUT_INTERNAL_ERROR -1
static const char *FILENAME = "output.c";
/* ***************************** */ /* ***************************** */
/* Types */ /* Types */
/* ***************************** */ /* ***************************** */
@@ -85,7 +83,7 @@ static Output_t *AvailableOutput[] =
static void printOutputCapabilities() static void printOutputCapabilities()
{ {
int i, j; int i, j;
output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
output_printf(10, "Capabilities:\n"); output_printf(10, "Capabilities:\n");
for (i = 0; AvailableOutput[i] != NULL; i++) for (i = 0; AvailableOutput[i] != NULL; i++)
{ {
@@ -105,7 +103,7 @@ static void printOutputCapabilities()
static void OutputAdd(Context_t *context, char *port) static void OutputAdd(Context_t *context, char *port)
{ {
int i, j; int i, j;
output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
for (i = 0; AvailableOutput[i] != NULL; i++) for (i = 0; AvailableOutput[i] != NULL; i++)
{ {
for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++) for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++)
@@ -134,7 +132,7 @@ static void OutputAdd(Context_t *context, char *port)
static void OutputDel(Context_t *context, char *port) static void OutputDel(Context_t *context, char *port)
{ {
output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); output_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
if (!strcmp("audio", port)) if (!strcmp("audio", port))
{ {
context->output->audio = NULL; context->output->audio = NULL;
@@ -153,7 +151,7 @@ static int Command(void *_context, OutputCmd_t command, void *argument)
{ {
Context_t *context = (Context_t *) _context; Context_t *context = (Context_t *) _context;
int ret = cERR_OUTPUT_NO_ERROR; int ret = cERR_OUTPUT_NO_ERROR;
output_printf(10, "%s::%s Command %d\n", FILENAME, __FUNCTION__, command); output_printf(10, "%s::%s Command %d\n", __FILE__, __FUNCTION__, command);
switch (command) switch (command)
{ {
case OUTPUT_OPEN: case OUTPUT_OPEN:
@@ -542,11 +540,11 @@ static int Command(void *_context, OutputCmd_t command, void *argument)
} }
} }
default: default:
output_err("%s::%s OutputCmd %d not supported!\n", FILENAME, __FUNCTION__, command); output_err("%s::%s OutputCmd %d not supported!\n", __FILE__, __FUNCTION__, command);
ret = cERR_OUTPUT_INTERNAL_ERROR; ret = cERR_OUTPUT_INTERNAL_ERROR;
break; break;
} }
output_printf(10, "%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); output_printf(10, "%s::%s exiting with value %d\n", __FILE__, __FUNCTION__, ret);
return ret; return ret;
} }

View File

@@ -68,8 +68,6 @@ if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x);
#define cERR_SUBTITLE_NO_ERROR 0 #define cERR_SUBTITLE_NO_ERROR 0
#define cERR_SUBTITLE_ERROR -1 #define cERR_SUBTITLE_ERROR -1
static const char FILENAME[] = __FILE__;
/* /*
Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text