Skip to content

Commit

Permalink
Fix nasa#1353, Align mismatched function prototype/implementation par…
Browse files Browse the repository at this point in the history
…ameter names
  • Loading branch information
thnkslprpt committed Feb 24, 2023
1 parent a9fece5 commit 5f664fe
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 76 deletions.
2 changes: 1 addition & 1 deletion src/os/inc/osapi-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ int32 OS_remove(const char *path);
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERROR if the file could not be opened or renamed.
* @retval #OS_INVALID_POINTER if old or new are NULL
* @retval #OS_INVALID_POINTER if old_filename or new_filename are NULL
* @retval #OS_FS_ERR_PATH_INVALID if path cannot be parsed
* @retval #OS_FS_ERR_PATH_TOO_LONG if the paths given are too long to be stored locally
* @retval #OS_FS_ERR_NAME_TOO_LONG if the new name is too long to be stored locally
Expand Down
2 changes: 1 addition & 1 deletion src/os/inc/osapi-module.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const
* module subsystem does not provide a facility to iterate through the
* symbol table, then the #OS_ERR_NOT_IMPLEMENTED status code is returned.
*
* @param[in] filename File to write to @nonnull
* @param[in] filename File to write to @nonnull
* @param[in] size_limit Maximum number of bytes to write
*
* @return Execution status, see @ref OSReturnCodes
Expand Down
2 changes: 1 addition & 1 deletion src/os/inc/osapi-timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef struct
* The callback function should be declared according to the OS_TimerCallback_t
* function pointer type. The timer_id value is passed to the callback function.
*
* @note clock_accuracy comes from the underlying OS tick value. The nearest integer
* @note clock_accuracy comes from the underlying OS tick value. The nearest integer
* microsecond value is returned, so may not be exact.
*
* @note This configuration API must not be used from the context of a timer callback.
Expand Down
2 changes: 1 addition & 1 deletion src/os/portable/os-impl-no-symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int32 OS_ModuleSymbolLookup_Impl(const OS_object_token_t *token, cpuaddr *Symbol
*
* See prototype for argument/return detail
*-----------------------------------------------------------------*/
int32 OS_SymbolTableDump_Impl(const char *filename, size_t SizeLimit)
int32 OS_SymbolTableDump_Impl(const char *filename, size_t size_limit)
{
return OS_ERR_NOT_IMPLEMENTED;
}
2 changes: 1 addition & 1 deletion src/os/portable/os-impl-posix-dl-symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int32 OS_ModuleSymbolLookup_Impl(const OS_object_token_t *token, cpuaddr *Symbol
* POSIX DL does not provide
*
*-----------------------------------------------------------------*/
int32 OS_SymbolTableDump_Impl(const char *filename, size_t SizeLimit)
int32 OS_SymbolTableDump_Impl(const char *filename, size_t size_limit)
{
/*
* Limiting strictly to POSIX-defined API means there is no defined
Expand Down
14 changes: 7 additions & 7 deletions src/os/portable/os-impl-posix-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int32 OS_FileOpen_Impl(const OS_object_token_t *token, const char *local_path, i
* See prototype for argument/return detail
*
*-----------------------------------------------------------------*/
int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats)
int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *filestat)
{
struct stat st;
mode_t readbits;
Expand All @@ -139,7 +139,7 @@ int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats)
return OS_ERROR;
}

FileStats->FileSize = st.st_size;
filestat->FileSize = st.st_size;

/*
* NOTE: Traditional timestamps are only a whole number of seconds (time_t)
Expand All @@ -164,12 +164,12 @@ int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats)
filetime.tv_nsec = 0;
#endif

FileStats->FileTime = OS_TimeAssembleFromNanoseconds(filetime.tv_sec, filetime.tv_nsec);
filestat->FileTime = OS_TimeAssembleFromNanoseconds(filetime.tv_sec, filetime.tv_nsec);

/* note that the "fst_mode" member is already zeroed by the caller */
if (S_ISDIR(st.st_mode))
{
FileStats->FileModeBits |= OS_FILESTAT_MODE_DIR;
filestat->FileModeBits |= OS_FILESTAT_MODE_DIR;
}

/* always check world bits */
Expand All @@ -195,15 +195,15 @@ int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats)

if (st.st_mode & readbits)
{
FileStats->FileModeBits |= OS_FILESTAT_MODE_READ;
filestat->FileModeBits |= OS_FILESTAT_MODE_READ;
}
if (st.st_mode & writebits)
{
FileStats->FileModeBits |= OS_FILESTAT_MODE_WRITE;
filestat->FileModeBits |= OS_FILESTAT_MODE_WRITE;
}
if (st.st_mode & execbits)
{
FileStats->FileModeBits |= OS_FILESTAT_MODE_EXEC;
filestat->FileModeBits |= OS_FILESTAT_MODE_EXEC;
}

return OS_SUCCESS;
Expand Down
4 changes: 2 additions & 2 deletions src/os/posix/src/os-impl-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ void OS_Unlock_Global_Impl(osal_objtype_t idtype)
* See prototype for argument/return detail
*
*-----------------------------------------------------------------*/
void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts)
void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts)
{
OS_impl_objtype_lock_t *impl;
struct timespec ts;

impl = OS_impl_objtype_lock_table[idtype];
impl = OS_impl_objtype_lock_table[objtype];

/*
* because pthread_cond_timedwait() is also a cancellation point,
Expand Down
6 changes: 3 additions & 3 deletions src/os/rtems/src/os-impl-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void OS_Unlock_Global_Impl(osal_objtype_t idtype)
* See prototype for argument/return detail
*
*-----------------------------------------------------------------*/
void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts)
void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts)
{
rtems_interval wait_ticks;

Expand All @@ -139,9 +139,9 @@ void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts)
wait_ticks = 100;
}

OS_Unlock_Global_Impl(idtype);
OS_Unlock_Global_Impl(objtype);
rtems_task_wake_after(wait_ticks);
OS_Lock_Global_Impl(idtype);
OS_Lock_Global_Impl(objtype);
}

/****************************************************************************************
Expand Down
10 changes: 5 additions & 5 deletions src/os/shared/src/osapi-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,18 +342,18 @@ int32 OS_remove(const char *path)
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_rename(const char *old, const char *new)
int32 OS_rename(const char *old_filename, const char *new_filename)
{
OS_object_iter_t iter;
OS_stream_internal_record_t *stream;
int32 return_code;
char old_path[OS_MAX_LOCAL_PATH_LEN];
char new_path[OS_MAX_LOCAL_PATH_LEN];

return_code = OS_TranslatePath(old, old_path);
return_code = OS_TranslatePath(old_filename, old_path);
if (return_code == OS_SUCCESS)
{
return_code = OS_TranslatePath(new, new_path);
return_code = OS_TranslatePath(new_filename, new_path);
}

if (return_code == OS_SUCCESS)
Expand All @@ -369,9 +369,9 @@ int32 OS_rename(const char *old, const char *new)
{
stream = OS_OBJECT_TABLE_GET(OS_stream_table, iter.token);

if (stream->socket_domain == OS_SocketDomain_INVALID && strcmp(stream->stream_name, old) == 0)
if (stream->socket_domain == OS_SocketDomain_INVALID && strcmp(stream->stream_name, old_filename) == 0)
{
strncpy(stream->stream_name, new, sizeof(stream->stream_name) - 1);
strncpy(stream->stream_name, new_filename, sizeof(stream->stream_name) - 1);
stream->stream_name[sizeof(stream->stream_name) - 1] = 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/os/shared/src/osapi-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ void OS_ForEachObject(osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr,
void OS_ForEachObjectOfType(osal_objtype_t objtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr,
void *callback_arg)
{
OS_object_iter_t iter;
Expand All @@ -1369,7 +1369,7 @@ void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgC
filter.user_callback = callback_ptr;
filter.user_arg = callback_arg;

if (OS_ObjectIdIteratorInit(OS_ForEachFilterCreator, &filter, idtype, &iter) == OS_SUCCESS)
if (OS_ObjectIdIteratorInit(OS_ForEachFilterCreator, &filter, objtype, &iter) == OS_SUCCESS)
{
while (OS_ObjectIdIteratorGetNext(&iter))
{
Expand Down
24 changes: 12 additions & 12 deletions src/os/shared/src/osapi-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,28 +296,28 @@ int32 OS_ModuleUnload(osal_id_t module_id)
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop)
int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_info)
{
OS_common_record_t * record;
OS_module_internal_record_t *module;
int32 return_code;
OS_object_token_t token;

/* Check parameters */
OS_CHECK_POINTER(module_prop);
OS_CHECK_POINTER(module_info);

memset(module_prop, 0, sizeof(OS_module_prop_t));
memset(module_info, 0, sizeof(OS_module_prop_t));

return_code = OS_ObjectIdGetById(OS_LOCK_MODE_GLOBAL, LOCAL_OBJID_TYPE, module_id, &token);
if (return_code == OS_SUCCESS)
{
record = OS_OBJECT_TABLE_GET(OS_global_module_table, token);
module = OS_OBJECT_TABLE_GET(OS_module_table, token);

strncpy(module_prop->name, record->name_entry, sizeof(module_prop->name) - 1);
strncpy(module_prop->filename, module->file_name, sizeof(module_prop->filename) - 1);
strncpy(module_info->name, record->name_entry, sizeof(module_info->name) - 1);
strncpy(module_info->filename, module->file_name, sizeof(module_info->filename) - 1);

return_code = OS_ModuleGetInfo_Impl(&token, module_prop);
return_code = OS_ModuleGetInfo_Impl(&token, module_info);

OS_ObjectIdRelease(&token);
}
Expand All @@ -331,29 +331,29 @@ int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop)
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_SymbolLookup(cpuaddr *SymbolAddress, const char *SymbolName)
int32 OS_SymbolLookup(cpuaddr *symbol_address, const char *SymbolName)
{
int32 return_code;
int32 staticsym_status;

/*
** Check parameters
*/
OS_CHECK_POINTER(SymbolAddress);
OS_CHECK_POINTER(symbol_address);
OS_CHECK_POINTER(SymbolName);

/*
* attempt to find the symbol in the symbol table
*/
return_code = OS_SymbolLookup_Impl(SymbolAddress, SymbolName);
return_code = OS_SymbolLookup_Impl(symbol_address, SymbolName);

/*
* If the OS call did not find the symbol or the loader is
* disabled, then check if a static symbol table is present
*/
if (return_code != OS_SUCCESS)
{
staticsym_status = OS_SymbolLookup_Static(SymbolAddress, SymbolName, NULL);
staticsym_status = OS_SymbolLookup_Static(symbol_address, SymbolName, NULL);

/*
* Only overwrite the return code if static lookup was successful.
Expand Down Expand Up @@ -420,7 +420,7 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_SymbolTableDump(const char *filename, size_t SizeLimit)
int32 OS_SymbolTableDump(const char *filename, size_t size_limit)
{
int32 return_code;
char translated_path[OS_MAX_LOCAL_PATH_LEN];
Expand Down Expand Up @@ -453,7 +453,7 @@ int32 OS_SymbolTableDump(const char *filename, size_t SizeLimit)
return return_code;
}

return_code = OS_SymbolTableDump_Impl(translated_path, SizeLimit);
return_code = OS_SymbolTableDump_Impl(translated_path, size_limit);

OS_ObjectIdTransactionCancel(&token);

Expand Down
11 changes: 6 additions & 5 deletions src/os/shared/src/osapi-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ static int32 OS_DoTimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_ref_id, OS_ArgCallback_t callback_ptr,
int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_id, OS_ArgCallback_t callback_ptr,
void *callback_arg)
{
return (OS_DoTimerAdd(timer_id, timer_name, timebase_ref_id, callback_ptr, callback_arg, 0));
return (OS_DoTimerAdd(timer_id, timer_name, timebase_id, callback_ptr, callback_arg, 0));
}

/*----------------------------------------------------------------
Expand All @@ -226,7 +226,8 @@ static void OS_Timer_NoArgCallback(osal_id_t objid, void *arg)
* See description in API and header file for detail
*
*-----------------------------------------------------------------*/
int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accuracy, OS_TimerCallback_t callback_ptr)
int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *clock_accuracy,
OS_TimerCallback_t callback_ptr)
{
int32 return_code;
osal_id_t timebase_ref_id;
Expand All @@ -239,7 +240,7 @@ int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accura
*/
OS_CHECK_POINTER(timer_id);
OS_CHECK_APINAME(timer_name);
OS_CHECK_POINTER(accuracy);
OS_CHECK_POINTER(clock_accuracy);
OS_CHECK_POINTER(callback_ptr);

/*
Expand Down Expand Up @@ -277,7 +278,7 @@ int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accura
}
else
{
*accuracy = OS_SharedGlobalVars.MicroSecPerTick;
*clock_accuracy = OS_SharedGlobalVars.MicroSecPerTick;
}

return return_code;
Expand Down
Loading

0 comments on commit 5f664fe

Please sign in to comment.