Browse Source

Fixed code to work around compile warnings.

master
jiaojinxing 2 years ago
parent
commit
dee5945bac
  1. 2
      target/h/bLib.h
  2. 6
      target/src/bLib.c
  3. 6
      target/src/taskLib.c
  4. 2
      target/src/wdLib.c

2
target/h/bLib.h

@ -20,7 +20,7 @@
extern "C" {
#endif
int bcmp(char *buf1, char *buf2, size_t nbytes);
int bcmp(const void *buf1, const void *buf2, size_t nbytes);
void binvert(char *buf, size_t nbytes);
void bswap(char *buf1, char *buf2, size_t nbytes);
void swab(char *source, char *destination, size_t nbytes);

6
target/src/bLib.c

@ -16,10 +16,10 @@
/*
* bcmp - compare one buffer to another
*/
int bcmp (char *buf1, char *buf2, size_t nbytes)
int bcmp (const void *buf1, const void *buf2, size_t nbytes)
{
unsigned char *p1;
unsigned char *p2;
const unsigned char *p1;
const unsigned char *p2;
if (nbytes == 0) {
return (0);

6
target/src/taskLib.c

@ -96,7 +96,7 @@ void vxWorksTaskInit (void)
API_ThreadGetName(task, vxTcb[tid].name);
if (API_ThreadCleanupPush(taskClrTcb, (PVOID)tid)) {
if (API_ThreadCleanupPush(taskClrTcb, (PVOID)(ULONG)tid)) {
fprintf(stderr, "vxWorks task cleanup push error: %s\n", strerror(errno));
}
}
@ -162,7 +162,7 @@ LW_LIB_HOOK_STATIC void *taskWrapper (WIND_TCB *pTcb)
vxRestart[tid] = LW_FALSE;
if (pTcb->entry) {
return ((void *)pTcb->entry(pTcb->arg[0], pTcb->arg[1], pTcb->arg[2],
return ((void *)(ULONG)pTcb->entry(pTcb->arg[0], pTcb->arg[1], pTcb->arg[2],
pTcb->arg[3], pTcb->arg[4], pTcb->arg[5], pTcb->arg[6],
pTcb->arg[7], pTcb->arg[8], pTcb->arg[9]));
} else {
@ -234,7 +234,7 @@ STATUS taskInit (WIND_TCB *pTcb, char *name, int priority,
}
pTcb->id = HANDLE_TO_TID(pTcb->task);
if (API_ThreadCleanupPushEx(pTcb->task, taskClrTcb, (PVOID)pTcb->id)) {
if (API_ThreadCleanupPushEx(pTcb->task, taskClrTcb, (PVOID)(ULONG)pTcb->id)) {
API_ThreadDelete(&pTcb->task, LW_NULL);
API_EventSetDelete(&pTcb->event);
return (ERROR);

2
target/src/wdLib.c

@ -83,7 +83,7 @@ STATUS wdStart (WDOG_ID wdId, int delay, FUNCPTR pRoutine,
ULONG ulError;
ulError = API_TimerStart(wdId, vx2syWdTo(delay), LW_OPTION_MANUAL_RESTART,
(PTIMER_CALLBACK_ROUTINE)pRoutine, (PVOID)parameter);
(PTIMER_CALLBACK_ROUTINE)pRoutine, (PVOID)(ULONG)parameter);
if (ulError) {
return (ERROR);
} else {

Loading…
Cancel
Save