summaryrefslogtreecommitdiff
path: root/src/common/ers.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 15:38:09 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:42:50 +0200
commit8b4f35532c8fd7c7f0939756923fdaf14ee39531 (patch)
tree2a5a69e909538ecc81cdcd37b0dd74e0a046e021 /src/common/ers.c
parent3f3f2e7ec09087b57148a0fb229de26293c5a462 (diff)
downloadhercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.gz
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.bz2
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.xz
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.zip
Removed unsafe pointer typedefs
- If a variable doesn't look like a pointer... Maybe it might be a pointer after all. Please, give me back my '*' sign. - See CERT DCL05-C. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/ers.c')
-rw-r--r--src/common/ers.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/ers.c b/src/common/ers.c
index 0842d9e15..c8a11d2a9 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -185,7 +185,7 @@ static void ers_free_cache(ers_cache_t *cache, bool remove)
aFree(cache);
}
-static void *ers_obj_alloc_entry(ERS self)
+static void *ers_obj_alloc_entry(ERS *self)
{
struct ers_instance_t *instance = (struct ers_instance_t *)self;
void *ret;
@@ -225,7 +225,7 @@ static void *ers_obj_alloc_entry(ERS self)
return ret;
}
-static void ers_obj_free_entry(ERS self, void *entry)
+static void ers_obj_free_entry(ERS *self, void *entry)
{
struct ers_instance_t *instance = (struct ers_instance_t *)self;
struct ers_list *reuse = (struct ers_list *)((unsigned char *)entry - sizeof(struct ers_list));
@@ -247,7 +247,7 @@ static void ers_obj_free_entry(ERS self, void *entry)
instance->Cache->UsedObjs--;
}
-static size_t ers_obj_entry_size(ERS self)
+static size_t ers_obj_entry_size(ERS *self)
{
struct ers_instance_t *instance = (struct ers_instance_t *)self;
@@ -259,7 +259,7 @@ static size_t ers_obj_entry_size(ERS self)
return instance->Cache->ObjectSize;
}
-static void ers_obj_destroy(ERS self)
+static void ers_obj_destroy(ERS *self)
{
struct ers_instance_t *instance = (struct ers_instance_t *)self;
@@ -289,7 +289,7 @@ static void ers_obj_destroy(ERS self)
aFree(instance);
}
-void ers_cache_size(ERS self, unsigned int new_size) {
+void ers_cache_size(ERS *self, unsigned int new_size) {
struct ers_instance_t *instance = (struct ers_instance_t *)self;
nullpo_retv(instance);
@@ -302,7 +302,7 @@ void ers_cache_size(ERS self, unsigned int new_size) {
}
-ERS ers_new(uint32 size, char *name, enum ERSOptions options)
+ERS *ers_new(uint32 size, char *name, enum ERSOptions options)
{
struct ers_instance_t *instance;
CREATE(instance,struct ers_instance_t, 1);
@@ -387,7 +387,7 @@ void ers_final(void) {
while( instance ) {
next = instance->Next;
- ers_obj_destroy((ERS)instance);
+ ers_obj_destroy((ERS*)instance);
instance = next;
}
}