Skip to content
Snippets Groups Projects
Commit aba43ad9 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix typos and missing prototypes necessary for Win32 build

Reviewing this header file, it even included this now misleading comment:
/* Return new value: */
.. protected_int32_adjust(...)

<shrug> Fixed that too.
parent 1581ed4b
No related branches found
No related tags found
No related merge requests found
Pipeline #9030 passed
...@@ -282,7 +282,7 @@ uint64_t protected_uint64_adjust(protected_uint64_t* i, int64_t adjustment) ...@@ -282,7 +282,7 @@ uint64_t protected_uint64_adjust(protected_uint64_t* i, int64_t adjustment)
oldval = i->value; oldval = i->value;
i->value += adjustment; i->value += adjustment;
pthread_mutex_unlock(&i->mutex); pthread_mutex_unlock(&i->mutex);
return newval; return oldval;
} }
// protected_int*_adjust_fetch() return the *new* (adjusted) integer value // protected_int*_adjust_fetch() return the *new* (adjusted) integer value
...@@ -295,7 +295,7 @@ int32_t protected_int32_adjust_fetch(protected_int32_t* i, int32_t adjustment) ...@@ -295,7 +295,7 @@ int32_t protected_int32_adjust_fetch(protected_int32_t* i, int32_t adjustment)
return newval; return newval;
} }
uint32_t protected_uint32_adjust(protected_uint32_t* i, int32_t adjustment) uint32_t protected_uint32_adjust_fetch(protected_uint32_t* i, int32_t adjustment)
{ {
uint32_t newval; uint32_t newval;
pthread_mutex_lock(&i->mutex); pthread_mutex_lock(&i->mutex);
...@@ -304,7 +304,7 @@ uint32_t protected_uint32_adjust(protected_uint32_t* i, int32_t adjustment) ...@@ -304,7 +304,7 @@ uint32_t protected_uint32_adjust(protected_uint32_t* i, int32_t adjustment)
return newval; return newval;
} }
int64_t protected_int64_adjust(protected_int64_t* i, int64_t adjustment) int64_t protected_int64_adjust_fetch(protected_int64_t* i, int64_t adjustment)
{ {
int64_t newval; int64_t newval;
pthread_mutex_lock(&i->mutex); pthread_mutex_lock(&i->mutex);
...@@ -313,7 +313,7 @@ int64_t protected_int64_adjust(protected_int64_t* i, int64_t adjustment) ...@@ -313,7 +313,7 @@ int64_t protected_int64_adjust(protected_int64_t* i, int64_t adjustment)
return newval; return newval;
} }
uint64_t protected_uint64_adjust(protected_uint64_t* i, int64_t adjustment) uint64_t protected_uint64_adjust_fetch(protected_uint64_t* i, int64_t adjustment)
{ {
uint64_t newval; uint64_t newval;
pthread_mutex_lock(&i->mutex); pthread_mutex_lock(&i->mutex);
......
...@@ -260,15 +260,21 @@ DLLEXPORT void protected_int32_init(protected_int32_t*, int32_t value); ...@@ -260,15 +260,21 @@ DLLEXPORT void protected_int32_init(protected_int32_t*, int32_t value);
DLLEXPORT void protected_int64_init(protected_int64_t*, int64_t value); DLLEXPORT void protected_int64_init(protected_int64_t*, int64_t value);
/* Return new value: */ /* Return new value: */
DLLEXPORT int32_t protected_int32_adjust(protected_int32_t*, int32_t adjustment); DLLEXPORT int32_t protected_int32_adjust_fetch(protected_int32_t*, int32_t adjustment);
DLLEXPORT int32_t protected_int32_set(protected_int32_t*, int32_t val); DLLEXPORT int32_t protected_int32_set(protected_int32_t*, int32_t val);
DLLEXPORT uint32_t protected_uint32_adjust(protected_uint32_t*, int32_t adjustment); DLLEXPORT uint32_t protected_uint32_adjust_fetch(protected_uint32_t*, int32_t adjustment);
DLLEXPORT uint32_t protected_uint32_set(protected_uint32_t*, uint32_t val); DLLEXPORT uint32_t protected_uint32_set(protected_uint32_t*, uint32_t val);
DLLEXPORT int64_t protected_int64_adjust(protected_int64_t*, int64_t adjustment); DLLEXPORT int64_t protected_int64_adjust_fetch(protected_int64_t*, int64_t adjustment);
DLLEXPORT int64_t protected_int64_set(protected_int64_t*, int64_t val); DLLEXPORT int64_t protected_int64_set(protected_int64_t*, int64_t val);
DLLEXPORT uint64_t protected_uint64_adjust(protected_uint64_t*, int64_t adjustment); DLLEXPORT uint64_t protected_uint64_adjust_fetch(protected_uint64_t*, int64_t adjustment);
DLLEXPORT uint64_t protected_uint64_set(protected_uint64_t*, uint64_t adjustment); DLLEXPORT uint64_t protected_uint64_set(protected_uint64_t*, uint64_t adjustment);
/* Return old value: */
DLLEXPORT int32_t protected_int32_adjust(protected_int32_t*, int32_t adjustment);
DLLEXPORT uint32_t protected_uint32_adjust(protected_uint32_t*, int32_t adjustment);
DLLEXPORT int64_t protected_int64_adjust(protected_int64_t*, int64_t adjustment);
DLLEXPORT uint64_t protected_uint64_adjust(protected_uint64_t*, int64_t adjustment);
#endif #endif
#if defined(__cplusplus) #if defined(__cplusplus)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment