(autosave) turn some functions static

This commit is contained in:
twinaphex 2016-03-24 04:47:35 +01:00
parent 1b289c0f05
commit 84ff9207f9
2 changed files with 11 additions and 30 deletions

View File

@ -149,12 +149,13 @@ static void autosave_thread(void *data)
* Returns: pointer to new autosave_t object if successful, otherwise
* NULL.
**/
autosave_t *autosave_new(const char *path, const void *data, size_t size,
static autosave_t *autosave_new(const char *path,
const void *data, size_t size,
unsigned interval)
{
autosave_t *handle = (autosave_t*)calloc(1, sizeof(*handle));
if (!handle)
return NULL;
goto error;
handle->bufsize = size;
handle->interval = interval;
@ -163,10 +164,8 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
handle->retro_buffer = data;
if (!handle->buffer)
{
free(handle);
return NULL;
}
goto error;
memcpy(handle->buffer, handle->retro_buffer, handle->bufsize);
handle->lock = slock_new();
@ -176,6 +175,11 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
handle->thread = sthread_create(autosave_thread, handle);
return handle;
error:
if (handle)
free(handle);
return NULL;
}
/**
@ -184,7 +188,7 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
*
* Frees autosave object.
**/
void autosave_free(autosave_t *handle)
static void autosave_free(autosave_t *handle)
{
if (!handle)
return;

View File

@ -25,29 +25,6 @@ extern "C" {
typedef struct autosave autosave_t;
/**
* autosave_new:
* @path : path to autosave file
* @data : pointer to buffer
* @size : size of @data buffer
* @interval : interval at which saves should be performed.
*
* Create and initialize autosave object.
*
* Returns: pointer to new autosave_t object if successful, otherwise
* NULL.
**/
autosave_t *autosave_new(const char *path, const void *data,
size_t size, unsigned interval);
/**
* autosave_free:
* @handle : pointer to autosave object
*
* Frees autosave object.
**/
void autosave_free(autosave_t *handle);
/**
* lock_autosave:
*