Skip to content

Commit

Permalink
Missing void params
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorenar committed Nov 11, 2023
1 parent c7bfc17 commit 7ddc38d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Missing `void` params

## [1.1.0] - 2022-04-27

Updated to XDG Base Directory Specification version 0.8
Expand Down
20 changes: 10 additions & 10 deletions src/xdgdirs.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static struct DOXYGEN_UNNAMED {

#undef DOXYGEN_UNNAMED

void xdgDirs_clear()
void xdgDirs_clear(void)
{
if (xdgDirs_cache.initialized == 0) {
return;
Expand All @@ -139,7 +139,7 @@ void xdgDirs_clear()
xdgDirs_cache.initialized = 0;
}

int xdgDirs_init()
int xdgDirs_init(void)
{
if (xdgDirs_cache.initialized == 1) {
return 0;
Expand Down Expand Up @@ -170,7 +170,7 @@ int xdgDirs_init()
return 0;
}

void xdgDirs_refresh()
void xdgDirs_refresh(void)
{
xdgDirs_cache.initialized = -1;
xdgDirs_init();
Expand All @@ -191,39 +191,39 @@ void xdgDirs_refresh()

// User directories {{{1

const char* xdgDataHome()
const char* xdgDataHome(void)
{
XDGDIRS_RETURN(xdgDirs_cache.user.data);
}

const char* xdgStateHome()
const char* xdgStateHome(void)
{
XDGDIRS_RETURN(xdgDirs_cache.user.state);
}

const char* xdgConfigHome()
const char* xdgConfigHome(void)
{
XDGDIRS_RETURN(xdgDirs_cache.user.config);
}

const char* xdgCacheHome()
const char* xdgCacheHome(void)
{
XDGDIRS_RETURN(xdgDirs_cache.user.cache);
}

const char* xdgRuntimeDir()
const char* xdgRuntimeDir(void)
{
XDGDIRS_RETURN(xdgDirs_cache.user.runtime);
}

// System directories {{{1

xdgDirsList* xdgDataDirs()
xdgDirsList* xdgDataDirs(void)
{
XDGDIRS_RETURN(&xdgDirs_cache.system.data);
}

xdgDirsList* xdgConfigDirs()
xdgDirsList* xdgConfigDirs(void)
{
XDGDIRS_RETURN(&xdgDirs_cache.system.config);
}
Expand Down
20 changes: 10 additions & 10 deletions src/xdgdirs.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ typedef const struct xdgDirsList_t xdgDirsList;
*
* Returns 0 on success, positive value otherwise
*/
int xdgDirs_init();
int xdgDirs_init(void);

/** @brief Clear cached data
* @details
* Deinitializes cached data and frees memory
*
* Call when XDGBDS is no longer needed (presumably at the end of program)
*/
void xdgDirs_clear();
void xdgDirs_clear(void);

/** @brief Read environment variables again
* @details
* Clear cache with xdgDirs_clear() and initializes again with xdgDirs_init()
*/
void xdgDirs_refresh();
void xdgDirs_refresh(void);

/// @}

Expand All @@ -68,36 +68,36 @@ void xdgDirs_refresh();
* Base directory for user-specific data files (analogous to @c /usr/share)
* @return a path as described by the standards or NULL
*/
const char* xdgDataHome();
const char* xdgDataHome(void);

/** @brief Value of @c $XDG_STATE_HOME
* @details
* Base directory for user-specific state files
* @return a path as described by the standards or NULL
*/
const char* xdgStateHome();
const char* xdgStateHome(void);

/** @brief Value of @c $XDG_CONFIG_HOME
* @details
* Base directory for user-specific configuration files (analogous to @c /etc)
* @return a path as described by the standards or NULL
*/
const char* xdgConfigHome();
const char* xdgConfigHome(void);

/** @brief Value of @c $XDG_CACHE_HOME
* @details
* Base directory for user-specific non-essential data files (analogous to @c /var/cache)
* @return a path as described by the standards or NULL
*/
const char* xdgCacheHome();
const char* xdgCacheHome(void);

/** @brief Value of @c $XDG_RUNTIME_DIR
* @details
* Base directory for user-specific non-essential runtime files (including file
* objects such as sockets and named pipes)
* @return a path as described by the standards or NULL
*/
const char* xdgRuntimeDir();
const char* xdgRuntimeDir(void);

/// @}

Expand All @@ -113,15 +113,15 @@ const char* xdgRuntimeDir();
* See lists.c for example
* @return pointer to `const struct xdgDirsList_t`
*/
xdgDirsList* xdgDataDirs();
xdgDirsList* xdgDataDirs(void);

/** @brief Value of @c $XDG_CONFIG_DIRS
* @details
* Preference-ordered set of base directories to search for configuration
* files in addition to the @c $XDG_CONFIG_HOME base directory
* @return pointer to `const struct xdgDirsList_t`
*/
xdgDirsList* xdgConfigDirs();
xdgDirsList* xdgConfigDirs(void);

/// @}

Expand Down
2 changes: 1 addition & 1 deletion tests/test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <stdio.h>
#include <xdgdirs.h>
#include "xdgdirs.h"

int main()
{
Expand Down

0 comments on commit 7ddc38d

Please sign in to comment.