Skip to content

Commit

Permalink
Fix #1353, Align mismatched function prototype/implementation paramet…
Browse files Browse the repository at this point in the history
…er names
  • Loading branch information
thnkslprpt committed Jan 23, 2023
1 parent a9fece5 commit c0c8b3c
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 76 deletions.
6 changes: 3 additions & 3 deletions src/os/inc/osapi-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ int32 OS_remove(const char *path);
* operation based on a variety of potential configurations. For portability,
* it is recommended that applications ensure the file is closed prior to removal.
*
* @param[in] old_filename The original filename @nonnull
* @param[in] new_filename The desired filename @nonnull
* @param[in] old The original filename @nonnull
* @param[in] new The desired filename @nonnull
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
Expand All @@ -382,7 +382,7 @@ int32 OS_remove(const char *path);
* @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
*/
int32 OS_rename(const char *old_filename, const char *new_filename);
int32 OS_rename(const char *old, const char *new);

/*-------------------------------------------------------------------------------------*/
/**
Expand Down
4 changes: 2 additions & 2 deletions src/os/inc/osapi-idmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@ void OS_ForEachObject(osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void
* Loops through all defined OSAL objects of a specific type and calls callback_ptr on each one
* If creator_id is nonzero then only objects with matching creator id are processed.
*
* @param[in] objtype The type of objects to iterate
* @param[in] idtype The type of objects to iterate
* @param[in] creator_id Filter objects to those created by a specific task
* This may be passed as OS_OBJECT_CREATOR_ANY to return all objects
* @param[in] callback_ptr Function to invoke for each matching object ID
* @param[in] callback_arg Opaque Argument to pass to callback function (may be NULL)
*/
void OS_ForEachObjectOfType(osal_objtype_t objtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr,
void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr,
void *callback_arg);

/**@}*/
Expand Down
14 changes: 7 additions & 7 deletions src/os/inc/osapi-module.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ typedef const struct
* The static table is intended to support embedded targets that do
* not have module loading capability or have it disabled.
*
* @param[out] symbol_address Set to the address of the symbol @nonnull
* @param[out] SymbolAddress Set to the address of the symbol @nonnull
* @param[in] symbol_name Name of the symbol to look up @nonnull
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERROR if the symbol could not be found
* @retval #OS_INVALID_POINTER if one of the pointers passed in are NULL
*/
int32 OS_SymbolLookup(cpuaddr *symbol_address, const char *symbol_name);
int32 OS_SymbolLookup(cpuaddr *SymbolAddress, const char *symbol_name);

/*-------------------------------------------------------------------------------------*/
/**
Expand Down Expand Up @@ -171,18 +171,18 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const
* symbol table, then the #OS_ERR_NOT_IMPLEMENTED status code is returned.
*
* @param[in] filename File to write to @nonnull
* @param[in] size_limit Maximum number of bytes to write
* @param[in] SizeLimit Maximum number of bytes to write
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED
* @retval #OS_INVALID_POINTER if the filename argument is NULL
* @retval #OS_FS_ERR_PATH_INVALID if the filename argument is not valid
* @retval #OS_ERR_NAME_TOO_LONG if any of the symbol names are too long @covtest
* @retval #OS_ERR_OUTPUT_TOO_LARGE if the size_limit was reached before completing all symbols @covtest
* @retval #OS_ERR_OUTPUT_TOO_LARGE if the SizeLimit was reached before completing all symbols @covtest
* @retval #OS_ERROR if an other/unspecified error occurs @covtest
*/
int32 OS_SymbolTableDump(const char *filename, size_t size_limit);
int32 OS_SymbolTableDump(const char *filename, size_t SizeLimit);

/*-------------------------------------------------------------------------------------*/
/**
Expand Down Expand Up @@ -232,15 +232,15 @@ int32 OS_ModuleUnload(osal_id_t module_id);
* Returns information about the loadable module
*
* @param[in] module_id OSAL ID of the previously the loaded module
* @param[out] module_info Buffer to store module information @nonnull
* @param[out] module_prop Buffer to store module information @nonnull
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_INVALID_ID if the module id invalid
* @retval #OS_INVALID_POINTER if the pointer to the ModuleInfo structure is invalid
* @retval #OS_ERROR if an other/unspecified error occurs @covtest
*/
int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_info);
int32 OS_ModuleInfo(osal_id_t module_id, OS_module_prop_t *module_prop);
/**@}*/

#endif /* OSAPI_MODULE_H */
18 changes: 9 additions & 9 deletions src/os/inc/osapi-timebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct
* @note This configuration API must not be used from the context of a timer callback.
* Timers should only be configured from the context of normal OSAL tasks.
*
* @param[out] timebase_id will be set to the non-zero ID of the newly-created resource @nonnull
* @param[out] timer_id will be set to the non-zero ID of the newly-created resource @nonnull
* @param[in] timebase_name The name of the time base @nonnull
* @param[in] external_sync A synchronization function for BSP hardware-based timer ticks
*
Expand All @@ -86,7 +86,7 @@ typedef struct
* @retval #OS_ERR_NAME_TOO_LONG if the timebase_name is too long
* @retval #OS_INVALID_POINTER if a pointer argument is NULL
*/
int32 OS_TimeBaseCreate(osal_id_t *timebase_id, const char *timebase_name, OS_TimerSync_t external_sync);
int32 OS_TimeBaseCreate(osal_id_t *timer_id, const char *timebase_name, OS_TimerSync_t external_sync);

/*-------------------------------------------------------------------------------------*/
/**
Expand All @@ -105,7 +105,7 @@ int32 OS_TimeBaseCreate(osal_id_t *timebase_id, const char *timebase_name, OS_Ti
* @note This configuration API must not be used from the context of a timer callback.
* Timers should only be configured from the context of normal OSAL tasks.
*
* @param[in] timebase_id The timebase resource to configure
* @param[in] timer_id The timebase resource to configure
* @param[in] start_time The amount of delay for the first tick, in microseconds.
* @param[in] interval_time The amount of delay between ticks, in microseconds.
*
Expand All @@ -115,7 +115,7 @@ int32 OS_TimeBaseCreate(osal_id_t *timebase_id, const char *timebase_name, OS_Ti
* @retval #OS_ERR_INCORRECT_OBJ_STATE if called from timer/timebase context
* @retval #OS_TIMER_ERR_INVALID_ARGS if start_time or interval_time are out of range
*/
int32 OS_TimeBaseSet(osal_id_t timebase_id, uint32 start_time, uint32 interval_time);
int32 OS_TimeBaseSet(osal_id_t timer_id, uint32 start_time, uint32 interval_time);

/*-------------------------------------------------------------------------------------*/
/**
Expand All @@ -127,14 +127,14 @@ int32 OS_TimeBaseSet(osal_id_t timebase_id, uint32 start_time, uint32 interval_t
* @note This configuration API must not be used from the context of a timer callback.
* Timers should only be configured from the context of normal OSAL tasks.
*
* @param[in] timebase_id The timebase resource to delete
* @param[in] timer_id The timebase resource to delete
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_INVALID_ID if the id passed in is not a valid timebase
* @retval #OS_ERR_INCORRECT_OBJ_STATE if called from timer/timebase context
*/
int32 OS_TimeBaseDelete(osal_id_t timebase_id);
int32 OS_TimeBaseDelete(osal_id_t timer_id);

/*-------------------------------------------------------------------------------------*/
/**
Expand All @@ -145,17 +145,17 @@ int32 OS_TimeBaseDelete(osal_id_t timebase_id);
* @note This configuration API must not be used from the context of a timer callback.
* Timers should only be configured from the context of normal OSAL tasks.
*
* @param[out] timebase_id will be set to the non-zero ID of the matching resource @nonnull
* @param[out] timer_id will be set to the non-zero ID of the matching resource @nonnull
* @param[in] timebase_name The name of the timebase resource to find @nonnull
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER if timebase_id or timebase_name are NULL pointers
* @retval #OS_INVALID_POINTER if timer_id or timebase_name are NULL pointers
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NAME_NOT_FOUND if the name was not found in the table
* @retval #OS_ERR_INCORRECT_OBJ_STATE if called from timer/timebase context
*/
int32 OS_TimeBaseGetIdByName(osal_id_t *timebase_id, const char *timebase_name);
int32 OS_TimeBaseGetIdByName(osal_id_t *timer_id, const char *timebase_name);

/*-------------------------------------------------------------------------------------*/
/**
Expand Down
13 changes: 6 additions & 7 deletions 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 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 All @@ -71,7 +71,7 @@ typedef struct
*
* @param[out] timer_id Will be set to the non-zero resource ID of the timer object @nonnull
* @param[in] timer_name Name of the timer object @nonnull
* @param[out] clock_accuracy Expected precision of the timer, in microseconds. This
* @param[out] accuracy Expected precision of the timer, in microseconds. This
* is the underlying tick value rounded to the nearest
* microsecond integer. @nonnull
* @param[in] callback_ptr The function pointer of the timer callback @nonnull.
Expand All @@ -85,8 +85,7 @@ typedef struct
* @retval #OS_ERR_INCORRECT_OBJ_STATE if invoked from a timer context
* @retval #OS_TIMER_ERR_INTERNAL if there was an error programming the OS timer @covtest
*/
int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *clock_accuracy,
OS_TimerCallback_t callback_ptr);
int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *accuracy, OS_TimerCallback_t callback_ptr);

/*-------------------------------------------------------------------------------------*/
/**
Expand Down Expand Up @@ -116,21 +115,21 @@ int32 OS_TimerCreate(osal_id_t *timer_id, const char *timer_name, uint32 *clock_
*
* @param[out] timer_id Will be set to the non-zero resource ID of the timer object @nonnull
* @param[in] timer_name Name of the timer object @nonnull
* @param[in] timebase_id The time base resource to use as a reference
* @param[in] timebase_ref_id The time base resource to use as a reference
* @param[in] callback_ptr Application-provided function to invoke @nonnull
* @param[in] callback_arg Opaque argument to pass to callback function, may be NULL
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER if any parameters are NULL
* @retval #OS_ERR_INVALID_ID if the timebase_id parameter is not valid
* @retval #OS_ERR_INVALID_ID if the timebase_ref_id parameter is not valid
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NAME_TAKEN if the name is already in use by another timer.
* @retval #OS_ERR_NO_FREE_IDS if all of the timers are already allocated.
* @retval #OS_ERR_INCORRECT_OBJ_STATE if invoked from a timer context
* @retval #OS_TIMER_ERR_INTERNAL if there was an error programming the OS timer @covtest
*/
int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_id, OS_ArgCallback_t callback_ptr,
int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebase_ref_id, OS_ArgCallback_t callback_ptr,
void *callback_arg);

/*-------------------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion src/os/shared/inc/os-shared-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ int32 OS_ShellOutputToFile_Impl(const OS_object_token_t *token, const char *Cmd)
Returns: OS_SUCCESS on success, or relevant error code
------------------------------------------------------------------*/
int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *filestat);
int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats);

/*----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/os/shared/inc/os-shared-idmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void OS_WaitForStateChange(OS_object_token_t *token, uint32 attempts);
a simple OS_TaskDelay().
------------------------------------------------------------------*/
void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts);
void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts);

/*
Function prototypes for routines implemented in common layers but private to OSAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ int32 OS_FileRename_Impl(const char *old_path, const char *new_path)
* Generated stub function for OS_FileStat_Impl()
* ----------------------------------------------------
*/
int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *filestat)
int32 OS_FileStat_Impl(const char *local_path, os_fstat_t *FileStats)
{
UT_GenStub_SetupReturnBuffer(OS_FileStat_Impl, int32);

UT_GenStub_AddParam(OS_FileStat_Impl, const char *, local_path);
UT_GenStub_AddParam(OS_FileStat_Impl, os_fstat_t *, filestat);
UT_GenStub_AddParam(OS_FileStat_Impl, os_fstat_t *, FileStats);

UT_GenStub_Execute(OS_FileStat_Impl, Basic, NULL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ void OS_Unlock_Global_Impl(osal_objtype_t idtype)
* Generated stub function for OS_WaitForStateChange_Impl()
* ----------------------------------------------------
*/
void OS_WaitForStateChange_Impl(osal_objtype_t objtype, uint32 attempts)
void OS_WaitForStateChange_Impl(osal_objtype_t idtype, uint32 attempts)
{
UT_GenStub_AddParam(OS_WaitForStateChange_Impl, osal_objtype_t, objtype);
UT_GenStub_AddParam(OS_WaitForStateChange_Impl, osal_objtype_t, idtype);
UT_GenStub_AddParam(OS_WaitForStateChange_Impl, uint32, attempts);

UT_GenStub_Execute(OS_WaitForStateChange_Impl, Basic, NULL);
Expand Down
4 changes: 2 additions & 2 deletions src/unit-tests/ostimer-test/ut_ostimer_timerio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ void UT_os_reconftimercallback(osal_id_t timerId, void *arg)
}

/*--------------------------------------------------------------------------------*
** Syntax: int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *clock_accuracy, OS_TimerCallback_t
** Syntax: int32 OS_TimerCreate(uint32 *timer_id, const char *timer_name, uint32 *accuracy, OS_TimerCallback_t
*callback_ptr)
** Purpose: Creates a new timer and associates it with a callback routine
** Parameters: *timer_id - a pointer that will hold the timer id
** *timer_name - a pointer that holds the name of the timer to be created
** *clock_accuracy - a pointer that will hold the clock accuracy in microseconds
** *accuracy - a pointer that will hold the clock accuracy in microseconds
** callback_ptr - a function pointer to the timer's callback
** Returns: OS_INVALID_POINTER if any of the pointers passed in is null
** OS_ERR_NAME_TOO_LONG if the name passed in is too long
Expand Down
6 changes: 3 additions & 3 deletions src/ut-stubs/osapi-file-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ int32 OS_remove(const char *path)
* Generated stub function for OS_rename()
* ----------------------------------------------------
*/
int32 OS_rename(const char *old_filename, const char *new_filename)
int32 OS_rename(const char *old, const char *new)
{
UT_GenStub_SetupReturnBuffer(OS_rename, int32);

UT_GenStub_AddParam(OS_rename, const char *, old_filename);
UT_GenStub_AddParam(OS_rename, const char *, new_filename);
UT_GenStub_AddParam(OS_rename, const char *, old);
UT_GenStub_AddParam(OS_rename, const char *, new);

UT_GenStub_Execute(OS_rename, Basic, NULL);

Expand Down
4 changes: 2 additions & 2 deletions src/ut-stubs/osapi-idmap-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ void OS_ForEachObject(osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void
* Generated stub function for OS_ForEachObjectOfType()
* ----------------------------------------------------
*/
void OS_ForEachObjectOfType(osal_objtype_t objtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr,
void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr,
void *callback_arg)
{
UT_GenStub_AddParam(OS_ForEachObjectOfType, osal_objtype_t, objtype);
UT_GenStub_AddParam(OS_ForEachObjectOfType, osal_objtype_t, idtype);
UT_GenStub_AddParam(OS_ForEachObjectOfType, osal_id_t, creator_id);
UT_GenStub_AddParam(OS_ForEachObjectOfType, OS_ArgCallback_t, callback_ptr);
UT_GenStub_AddParam(OS_ForEachObjectOfType, void *, callback_arg);
Expand Down
16 changes: 8 additions & 8 deletions src/ut-stubs/osapi-module-handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ void UT_DefaultHandler_OS_ModuleUnload(void *UserObj, UT_EntryKey_t FuncKey, con
*/
void UT_DefaultHandler_OS_ModuleInfo(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
{
OS_module_prop_t *module_info = UT_Hook_GetArgValueByName(Context, "module_info", OS_module_prop_t *);
OS_module_prop_t *module_prop = UT_Hook_GetArgValueByName(Context, "module_prop", OS_module_prop_t *);
int32 status;

UT_Stub_GetInt32StatusCode(Context, &status);

if (status == OS_SUCCESS &&
UT_Stub_CopyToLocal(UT_KEY(OS_ModuleInfo), module_info, sizeof(*module_info)) < sizeof(*module_info))
UT_Stub_CopyToLocal(UT_KEY(OS_ModuleInfo), module_prop, sizeof(*module_prop)) < sizeof(*module_prop))
{
memset(module_info, 0, sizeof(*module_info));
memset(module_prop, 0, sizeof(*module_prop));
}
}

Expand All @@ -121,7 +121,7 @@ void UT_DefaultHandler_OS_ModuleInfo(void *UserObj, UT_EntryKey_t FuncKey, const
*/
void UT_DefaultHandler_OS_SymbolLookup(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
{
cpuaddr *symbol_address = UT_Hook_GetArgValueByName(Context, "symbol_address", cpuaddr *);
cpuaddr *SymbolAddress = UT_Hook_GetArgValueByName(Context, "SymbolAddress", cpuaddr *);
int32 status;

/*
Expand All @@ -132,13 +132,13 @@ void UT_DefaultHandler_OS_SymbolLookup(void *UserObj, UT_EntryKey_t FuncKey, con

if (status != OS_SUCCESS)
{
*symbol_address = 0xDEADBEEFU;
*SymbolAddress = 0xDEADBEEFU;
}
else if (UT_Stub_CopyToLocal(UT_KEY(OS_SymbolLookup), symbol_address, sizeof(*symbol_address)) <
sizeof(*symbol_address))
else if (UT_Stub_CopyToLocal(UT_KEY(OS_SymbolLookup), SymbolAddress, sizeof(*SymbolAddress)) <
sizeof(*SymbolAddress))
{
/* return the dummy function when test didn't register anything else */
*symbol_address = (cpuaddr)&dummy_function;
*SymbolAddress = (cpuaddr)&dummy_function;
}
}

Expand Down
Loading

0 comments on commit c0c8b3c

Please sign in to comment.