summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/core.c9
-rw-r--r--src/common/malloc.c24
-rw-r--r--src/common/mapindex.c12
-rw-r--r--src/common/nullpo.c9
-rw-r--r--src/common/timer.c6
5 files changed, 32 insertions, 28 deletions
diff --git a/src/common/core.c b/src/common/core.c
index a0a6b4f16..deac7a514 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -69,8 +69,7 @@ sigfunc *compat_signal(int signo, sigfunc *func)
/*======================================
* CORE : Signal Sub Function
- *--------------------------------------
- */
+ *--------------------------------------*/
static void sig_proc(int sn)
{
static int is_called = 0;
@@ -174,8 +173,7 @@ const char* get_svn_revision(void)
/*======================================
* CORE : Display title
- *--------------------------------------
- */
+ *--------------------------------------*/
static void display_title(void)
{
//ClearScreen(); // clear screen and go up/left (0, 0 position in text)
@@ -213,8 +211,7 @@ void usercheck(void)
/*======================================
* CORE : MAINROUTINE
- *--------------------------------------
- */
+ *--------------------------------------*/
int main (int argc, char **argv)
{
{// initialize program arguments
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 859b58b5e..eda8c3fdb 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -189,7 +189,8 @@ static void block_free(struct block* p);
static void memmgr_info(void);
static unsigned int memmgr_usage_bytes = 0;
-void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
+void* _mmalloc(size_t size, const char *file, int line, const char *func )
+{
int i;
struct block *block;
size_t size_hash;
@@ -291,13 +292,15 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
return NULL;
};
-void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func ) {
+void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func )
+{
void *p = _mmalloc(num * size,file,line,func);
memset(p,0,num * size);
return p;
}
-void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func ) {
+void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func )
+{
size_t old_size;
if(memblock == NULL) {
return _mmalloc(size,file,line,func);
@@ -318,7 +321,8 @@ void* _mrealloc(void *memblock, size_t size, const char *file, int line, const c
}
}
-char* _mstrdup(const char *p, const char *file, int line, const char *func ) {
+char* _mstrdup(const char *p, const char *file, int line, const char *func )
+{
if(p == NULL) {
return NULL;
} else {
@@ -329,7 +333,8 @@ char* _mstrdup(const char *p, const char *file, int line, const char *func ) {
}
}
-void _mfree(void *ptr, const char *file, int line, const char *func ) {
+void _mfree(void *ptr, const char *file, int line, const char *func )
+{
struct unit_head *head;
size_t size_hash;
@@ -420,7 +425,8 @@ void _mfree(void *ptr, const char *file, int line, const char *func ) {
}
/* 現在の状況を表示する */
-static void memmgr_info(void) {
+static void memmgr_info(void)
+{
int i;
struct block *p;
ShowInfo("** Memory Manager Information **\n");
@@ -461,7 +467,8 @@ static void memmgr_info(void) {
}
/* ブロックを確保する */
-static struct block* block_malloc(void) {
+static struct block* block_malloc(void)
+{
if(block_unused != NULL) {
/* ブロック用の領域は確保済み */
struct block* ret = block_unused;
@@ -523,7 +530,8 @@ static struct block* block_malloc(void) {
}
}
-static void block_free(struct block* p) {
+static void block_free(struct block* p)
+{
/* free() せずに、未使用フラグを付けるだけ */
p->unit_size = 0;
/* 未使用ポインターを更新する */
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index 37afcad3d..36bd32cb5 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -64,7 +64,8 @@ int mapindex_addmap(int index, const char *name)
return 1;
}
-unsigned short mapindex_name2id(const char* name) {
+unsigned short mapindex_name2id(const char* name)
+{
//TODO: Perhaps use a db to speed this up? [Skotlex]
int i;
char map_name[MAP_NAME_LENGTH_EXT];
@@ -91,7 +92,8 @@ unsigned short mapindex_name2id(const char* name) {
#endif
}
-const char* mapindex_id2name(unsigned short id) {
+const char* mapindex_id2name(unsigned short id)
+{
if (id > MAX_MAPINDEX || !indexes[id].exists) {
ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", id);
return indexes[0].name; //Theorically this should never happen, hence we return this string to prevent null pointer crashes.
@@ -99,7 +101,8 @@ const char* mapindex_id2name(unsigned short id) {
return indexes[id].name;
}
-void mapindex_init(void) {
+void mapindex_init(void)
+{
FILE *fp;
char line[1024];
int last_index = -1;
@@ -130,5 +133,6 @@ void mapindex_init(void) {
fclose(fp);
}
-void mapindex_final(void) {
+void mapindex_final(void)
+{
}
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index 931846bd6..4383109a7 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -13,8 +13,7 @@ static void nullpo_info_core(const char *file, int line, const char *func,
/*======================================
* Nullチェック 及び 情報出力
- *--------------------------------------
- */
+ *--------------------------------------*/
int nullpo_chk_f(const char *file, int line, const char *func, const void *target,
const char *fmt, ...)
{
@@ -41,8 +40,7 @@ int nullpo_chk(const char *file, int line, const char *func, const void *target)
/*======================================
* nullpo情報出力(外部呼出し向けラッパ)
- *--------------------------------------
- */
+ *--------------------------------------*/
void nullpo_info_f(const char *file, int line, const char *func,
const char *fmt, ...)
{
@@ -61,8 +59,7 @@ void nullpo_info(const char *file, int line, const char *func)
/*======================================
* nullpo情報出力(Main)
- *--------------------------------------
- */
+ *--------------------------------------*/
static void nullpo_info_core(const char *file, int line, const char *func,
const char *fmt, va_list ap)
{
diff --git a/src/common/timer.c b/src/common/timer.c
index 09be7d949..2a7dba676 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -137,8 +137,7 @@ unsigned int gettick(void)
/*======================================
* CORE : Timer Heap
- *--------------------------------------
- */
+ *--------------------------------------*/
/// Adds a timer to the timer_heap
static void push_timer_heap(int tid)
{
@@ -197,8 +196,7 @@ static void push_timer_heap(int tid)
/*==========================
* Timer Management
- *--------------------------
- */
+ *--------------------------*/
/// Returns a free timer id.
static int acquire_timer(void)