summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPM.c4
-rw-r--r--src/common/HPM.h2
-rw-r--r--src/common/atomic.h6
-rw-r--r--src/common/conf.h2
-rw-r--r--src/common/db.c14
-rw-r--r--src/common/db.h6
-rw-r--r--src/common/ers.c8
-rw-r--r--src/common/ers.h14
-rw-r--r--src/common/grfio.c10
-rw-r--r--src/common/malloc.c4
-rw-r--r--src/common/mapindex.c2
-rw-r--r--src/common/mmo.h4
-rw-r--r--src/common/mutex.h16
-rw-r--r--src/common/showmsg.c6
-rw-r--r--src/common/showmsg.h4
-rw-r--r--src/common/socket.c14
-rw-r--r--src/common/spinlock.h2
-rw-r--r--src/common/sql.c10
-rw-r--r--src/common/sql.h6
-rw-r--r--src/common/strlib.c32
-rw-r--r--src/common/strlib.h10
-rw-r--r--src/common/sysinfo.c4
-rw-r--r--src/common/thread.c14
-rw-r--r--src/common/thread.h16
-rw-r--r--src/common/timer.c6
-rw-r--r--src/common/utils.c6
26 files changed, 111 insertions, 111 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c
index d33a4c1aa..f39954175 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -410,7 +410,7 @@ void hplugins_addToHPData(enum HPluginDataTypes type, unsigned int pluginID, voi
*(action.hdatac) += 1;
RECREATE(*(action.HPDataSRCPtr),struct HPluginData *,*(action.hdatac));
- /* RECREATE modified the addresss */
+ /* RECREATE modified the address */
HPDataSRC = *(action.HPDataSRCPtr);
HPDataSRC[*(action.hdatac) - 1] = HPData;
}
@@ -578,7 +578,7 @@ void* HPM_reallocz(void *p, size_t size, const char *file, int line, const char
char* HPM_astrdup(const char *p, const char *file, int line, const char *func) {
return iMalloc->astrdup(p,HPM_file2ptr(file),line,func);
}
-/* todo: add ability for tracking using pID for the upcoming runtime load/unload support. */
+/* TODO: add ability for tracking using pID for the upcoming runtime load/unload support. */
bool HPM_AddHook(enum HPluginHookType type, const char *target, void *hook, unsigned int pID) {
if( !HPM->hooking ) {
ShowError("HPM:AddHook Fail! '%s' tried to hook to '%s' but HPMHooking is disabled!\n",HPM->pid2name(pID),target);
diff --git a/src/common/HPM.h b/src/common/HPM.h
index 9c176cfd6..5667f605a 100644
--- a/src/common/HPM.h
+++ b/src/common/HPM.h
@@ -24,7 +24,7 @@
#define DLL HINSTANCE
#else // ! WIN32
#include <dlfcn.h>
- #ifdef RTLD_DEEPBIND // Certain linux ditributions require this, but it's not available everywhere
+ #ifdef RTLD_DEEPBIND // Certain linux distributions require this, but it's not available everywhere
#define plugin_open(x) dlopen((x),RTLD_NOW|RTLD_DEEPBIND)
#else // ! RTLD_DEEPBIND
#define plugin_open(x) dlopen((x),RTLD_NOW)
diff --git a/src/common/atomic.h b/src/common/atomic.h
index 1349d0887..526811a09 100644
--- a/src/common/atomic.h
+++ b/src/common/atomic.h
@@ -12,7 +12,7 @@
// - Compiler
// - Operating System
//
-// our Abstraction is fully API-Compatible to Microsofts implementation @ NT5.0+
+// our Abstraction is fully API-Compatible to Microsoft's implementation @ NT5.0+
//
#include "../common/cbasetypes.h"
@@ -23,7 +23,7 @@
#if _MSC_VER < 1800
#if !defined(_M_X64)
-// When compiling for windows 32bit, the 8byte interlocked operations are not provided by microsoft
+// When compiling for windows 32bit, the 8byte interlocked operations are not provided by Microsoft
// (because they need at least i586 so its not generic enough.. ... )
forceinline int64 InterlockedCompareExchange64(volatile int64 *dest, int64 exch, int64 _cmp){
_asm{
@@ -143,7 +143,7 @@ static forceinline int32 InterlockedExchange(volatile int32 *target, int32 val){
}//end: InterlockedExchange()
-#endif //endif compiler decission
+#endif //endif compiler decision
#endif /* _COMMON_ATOMIC_H_ */
diff --git a/src/common/conf.h b/src/common/conf.h
index e5b637e47..7c275bec2 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -10,7 +10,7 @@
#include "../../3rdparty/libconfig/libconfig.h"
/**
- * The libconfig interface -- specially for plugins, but we enforce it throughought the core to be consistent
+ * The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent
**/
struct libconfig_interface {
int (*read) (config_t *config, FILE *stream);
diff --git a/src/common/db.c b/src/common/db.c
index bbeaf0b61..11ac06c93 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -3,7 +3,7 @@
* For more information, see LICENCE in the main folder
*
* This file is separated in five sections:
- * (1) Private typedefs, enums, structures, defines and gblobal variables
+ * (1) Private typedefs, enums, structures, defines and global variables
* (2) Private functions
* (3) Protected functions used internally
* (4) Protected functions used in the interface of the database
@@ -89,15 +89,15 @@
* DBNColor - Enumeration of colors of the nodes. *
* DBNode - Structure of a node in RED-BLACK trees. *
* struct db_free - Structure that holds a deleted node to be freed. *
- * DBMap_impl - Struture of the database. *
+ * DBMap_impl - Structure of the database. *
* stats - Statistics about the database system. *
\*****************************************************************************/
/**
* If defined statistics about database nodes, database creating/destruction
- * and function usage are keept and displayed when finalizing the database
+ * and function usage are kept and displayed when finalizing the database
* system.
- * WARNING: This adds overhead to every database operation (not shure how much).
+ * WARNING: This adds overhead to every database operation (not sure how much).
* @private
* @see #DBStats
* @see #stats
@@ -511,7 +511,7 @@ static void db_rebalance_erase(DBNode node, DBNode *root)
}
// Remove the node from the tree
- if (y != node) { // both childs existed
+ if (y != node) { // both child existed
// put the left of 'node' in the left of 'y'
node->left->parent = y;
y->left = node->left;
@@ -2066,7 +2066,7 @@ static int db_obj_vforeach(DBMap* self, DBApply func, va_list args)
* Apply <code>func</code> to every entry in the database.
* Returns the sum of values returned by func.
* @param self Interface of the database
- * @param func Function to be applyed
+ * @param func Function to be applied
* @param ... Extra arguments for func
* @return Sum of the values returned by func
* @protected
@@ -2345,7 +2345,7 @@ static DBOptions db_obj_options(DBMap* self)
* db_default_cmp - Get the default comparator for a type of database.
* db_default_hash - Get the default hasher for a type of database.
* db_default_release - Get the default releaser for a type of database with the specified options.
- * db_custom_release - Get a releaser that behaves a certains way.
+ * db_custom_release - Get a releaser that behaves a certain way.
* db_alloc - Allocate a new database.
* db_i2key - Manual cast from 'int' to 'DBKey'.
* db_ui2key - Manual cast from 'unsigned int' to 'DBKey'.
diff --git a/src/common/db.h b/src/common/db.h
index f5714ceaf..4f8d6be79 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -106,7 +106,7 @@ typedef enum DBType {
} DBType;
/**
- * Bitfield of options that define the behaviour of the database.
+ * Bitfield of options that define the behavior of the database.
* See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the
* types of databases.
* @param DB_OPT_BASE Base options: does not duplicate keys, releases nothing
@@ -116,7 +116,7 @@ typedef enum DBType {
* @param DB_OPT_RELEASE_KEY Releases the key.
* @param DB_OPT_RELEASE_DATA Releases the data whenever an entry is removed
* from the database.
- * WARNING: for funtions that return the data (like DBMap::remove),
+ * WARNING: for functions that return the data (like DBMap::remove),
* a dangling pointer will be returned.
* @param DB_OPT_RELEASE_BOTH Releases both key and data.
* @param DB_OPT_ALLOW_NULL_KEY Allow NULL keys in the database.
@@ -365,7 +365,7 @@ struct DBIterator
};
/**
- * Public interface of a database. Only contains funtions.
+ * Public interface of a database. Only contains functions.
* All the functions take the interface as the first argument.
* @public
* @see #db_alloc(const char*,int,DBType,DBOptions,unsigned short)
diff --git a/src/common/ers.c b/src/common/ers.c
index 39e05a14c..0842d9e15 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -13,16 +13,16 @@
* If it has reusable entries (freed entry), it uses one. *
* So no assumption should be made about the data of the entry. *
* Entries should be freed in the manager they where allocated from. *
- * Failure to do so can lead to unexpected behaviours. *
+ * Failure to do so can lead to unexpected behaviors. *
* *
* <H2>Advantages:</H2> *
* - The same manager is used for entries of the same size. *
* So entries freed in one instance of the manager can be used by other *
* instances of the manager. *
* - Much less memory allocation/deallocation - program will be faster. *
- * - Avoids memory fragmentaion - program will run better for longer. *
+ * - Avoids memory fragmentation - program will run better for longer. *
* *
- * <H2>Disavantages:</H2> *
+ * <H2>Disadvantages:</H2> *
* - Unused entries are almost inevitable - memory being wasted. *
* - A manager will only auto-destroy when all of its instances are *
* destroyed so memory will usually only be recovered near the end. *
@@ -104,7 +104,7 @@ struct ers_instance_t {
// Interface to ERS
struct eri VTable;
- // Name, used for debbuging purpouses
+ // Name, used for debugging purposes
char *Name;
// Misc options
diff --git a/src/common/ers.h b/src/common/ers.h
index 7eceaf87a..f32680339 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -13,16 +13,16 @@
* If it has reusable entries (freed entry), it uses one. *
* So no assumption should be made about the data of the entry. *
* Entries should be freed in the manager they where allocated from. *
- * Failure to do so can lead to unexpected behaviours. *
+ * Failure to do so can lead to unexpected behaviors. *
* *
* <H2>Advantages:</H2> *
* - The same manager is used for entries of the same size. *
* So entries freed in one instance of the manager can be used by other *
* instances of the manager. *
* - Much less memory allocation/deallocation - program will be faster. *
- * - Avoids memory fragmentaion - program will run better for longer. *
+ * - Avoids memory fragmentation - program will run better for longer. *
* *
- * <H2>Disavantages:</H2> *
+ * <H2>Disadvantages:</H2> *
* - Unused entries are almost inevitable - memory being wasted. *
* - A manager will only auto-destroy when all of its instances are *
* destroyed so memory will usually only be recovered near the end. *
@@ -49,7 +49,7 @@
* ERS - Entry manager. *
* ers_new - Allocate an instance of an entry manager. *
* ers_report - Print a report about the current state. *
- * ers_final - Clears the remainder of the manangers. *
+ * ers_final - Clears the remainder of the managers. *
\*****************************************************************************/
/**
@@ -64,7 +64,7 @@
* By default it aligns to one byte, using the "natural order" of the entries.
* This should NEVER be set to zero or less.
* If greater than one, some memory can be wasted. This should never be needed
- * but is here just in case some aligment issues arise.
+ * but is here just in case some alignment issues arise.
*/
#ifndef ERS_ALIGNED
# define ERS_ALIGNED 1
@@ -102,7 +102,7 @@ typedef struct eri {
/**
* Free an entry allocated from this manager.
* WARNING: Does not check if the entry was allocated by this manager.
- * Freeing such an entry can lead to unexpected behaviour.
+ * Freeing such an entry can lead to unexpected behavior.
* @param self Interface of the entry manager
* @param entry Entry to be freed
*/
@@ -170,7 +170,7 @@ ERS ers_new(uint32 size, char *name, enum ERSOptions options);
void ers_report(void);
/**
- * Clears the remainder of the manangers
+ * Clears the remainder of the managers
**/
void ers_final(void);
#endif /* DISABLE_ERS / not DISABLE_ERS */
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 1111fb3f3..f592812f6 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -418,7 +418,7 @@ void* grfio_reads(const char* fname, int* size)
declen = (int)ftell(in);
fseek(in,0,SEEK_SET);
buf2 = (unsigned char *)aMalloc(declen+1); // +1 for resnametable zero-termination
- if(fread(buf2, 1, declen, in) != (size_t)declen) ShowError("An error occured in fread grfio_reads, fname=%s \n",fname);
+ if(fread(buf2, 1, declen, in) != (size_t)declen) ShowError("An error occurred in fread grfio_reads, fname=%s \n",fname);
fclose(in);
if( size )
@@ -440,7 +440,7 @@ void* grfio_reads(const char* fname, int* size)
int fsize = entry->srclen_aligned;
unsigned char *buf = (unsigned char *)aMalloc(fsize);
fseek(in, entry->srcpos, 0);
- if(fread(buf, 1, fsize, in) != (size_t)fsize) ShowError("An error occured in fread in grfio_reads, grfname=%s\n",grfname);
+ if(fread(buf, 1, fsize, in) != (size_t)fsize) ShowError("An error occurred in fread in grfio_reads, grfname=%s\n",grfname);
fclose(in);
buf2 = (unsigned char *)aMalloc(entry->declen+1); // +1 for resnametable zero-termination
@@ -583,7 +583,7 @@ static int grfio_entryread(const char* grfname, int gentry)
unsigned char *rBuf;
uLongf rSize, eSize;
- if(fread(eheader,1,8,fp) != 8) ShowError("An error occured in fread while reading eheader buffer\n");
+ if(fread(eheader,1,8,fp) != 8) ShowError("An error occurred in fread while reading header buffer\n");
rSize = getlong(eheader); // Read Size
eSize = getlong(eheader+4); // Extend Size
@@ -595,7 +595,7 @@ static int grfio_entryread(const char* grfname, int gentry)
rBuf = (unsigned char *)aMalloc(rSize); // Get a Read Size
grf_filelist = (unsigned char *)aMalloc(eSize); // Get a Extend Size
- if(fread(rBuf,1,rSize,fp) != rSize) ShowError("An error occured in fread \n");
+ if(fread(rBuf,1,rSize,fp) != rSize) ShowError("An error occurred in fread \n");
fclose(fp);
decode_zip(grf_filelist, &eSize, rBuf, rSize); // Decode function
aFree(rBuf);
@@ -827,7 +827,7 @@ void grfio_init(const char* fname)
if( grf_num == 0 )
ShowInfo("No GRF loaded, using default data directory\n");
- // Unneccessary area release of filelist
+ // Unnecessary area release of filelist
filelist_compact();
// Resource check
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 74303fa92..83d1d6656 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -776,7 +776,7 @@ static void memmgr_init (void)
{
#ifdef LOG_MEMMGR
sprintf(memmer_logfile, "log/%s.leaks", SERVER_NAME);
- ShowStatus("Memory manager initialised: "CL_WHITE"%s"CL_RESET"\n", memmer_logfile);
+ ShowStatus("Memory manager initialized: "CL_WHITE"%s"CL_RESET"\n", memmer_logfile);
memset(hash_unfill, 0, sizeof(hash_unfill));
#endif /* LOG_MEMMGR */
}
@@ -784,7 +784,7 @@ static void memmgr_init (void)
/*======================================
-* Initialise
+* Initialize
*--------------------------------------
*/
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index 5c69c7063..644f2f619 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -70,7 +70,7 @@ const char* mapindex_getmapname_ext(const char* string, char* output) {
}
/// Adds a map to the specified index
-/// Returns 1 if successful, 0 oherwise
+/// Returns 1 if successful, 0 otherwise
int mapindex_addmap(int index, const char* name) {
char map_name[MAP_NAME_LENGTH];
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 4ac7ee793..6ef5b50f5 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -26,7 +26,7 @@
// 20071106 - 2007-11-06aSakexe+ - 0x78, 0x7c, 0x22c
// 20080102 - 2008-01-02aSakexe+ - 0x2ec, 0x2ed , 0x2ee
// 20081126 - 2008-11-26aSakexe+ - 0x1a2
-// 20090408 - 2009-04-08aSakexe+ - 0x44a (dont use as it overlaps with RE client packets)
+// 20090408 - 2009-04-08aSakexe+ - 0x44a (don't use as it overlaps with RE client packets)
// 20080827 - 2008-08-27aRagexeRE+ - First RE Client
// 20081217 - 2008-12-17aRagexeRE+ - 0x6d (Note: This one still use old Char Info Packet Structure)
// 20081218 - 2008-12-17bRagexeRE+ - 0x6d (Note: From this one client use new Char Info Packet Structure)
@@ -120,7 +120,7 @@
#define MAX_GUILD_STORAGE 600
#define MAX_PARTY 12
#define MAX_GUILD (16+10*6) // Increased max guild members +6 per 1 extension levels [Lupus]
-#define MAX_GUILDPOSITION 20 // Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
+#define MAX_GUILDPOSITION 20 // Increased max guild positions to accommodate for all members [Valaris] (removed) [PoW]
#define MAX_GUILDEXPULSION 32
#define MAX_GUILDALLIANCE 16
#define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan]
diff --git a/src/common/mutex.h b/src/common/mutex.h
index f78e31841..ce13a28b7 100644
--- a/src/common/mutex.h
+++ b/src/common/mutex.h
@@ -57,23 +57,23 @@ racond racond_create();
/**
* Destroy a Condition variable
*
- * @param c - the condition varaible to destroy
+ * @param c - the condition variable to destroy
*/
void racond_destroy( racond c );
/**
- * Waits Until state is signalled
+ * Waits Until state is signaled
*
- * @param c - the condition var to wait for signalled state
- * @param m - the mutex used for syncronization
+ * @param c - the condition var to wait for signaled state
+ * @param m - the mutex used for synchronization
* @param timeout_ticks - timeout in ticks ( -1 = INFINITE )
*/
void racond_wait( racond c, ramutex m, sysint timeout_ticks);
/**
- * Sets the given condition var to signalled state
+ * Sets the given condition var to signaled state
*
- * @param c - condition var to set in signalled state.
+ * @param c - condition var to set in signaled state.
*
* @note:
* Only one waiter gets notified.
@@ -81,8 +81,8 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks);
void racond_signal( racond c );
/**
- * Sets notifys all waiting threads thats signalled.
- * @param c - condition var to set in signalled state
+ * Sets notifies all waiting threads thats signaled.
+ * @param c - condition var to set in signaled state
*
* @note:
* All Waiters getting notified.
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 2a8e2d5f8..ece10c1a8 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -88,7 +88,7 @@ int console_msg_log = 0;//[Ind] msg error logging
// XXX adapted from eApp (comments are left untouched) [flaviojs]
///////////////////////////////////////////////////////////////////////////////
-// ansi compatible printf with control sequence parser for windows
+// ANSI compatible printf with control sequence parser for windows
// fast hack, handle with care, not everything implemented
//
// \033[#;...;#m - Set Graphics Rendition (SGR)
@@ -147,7 +147,7 @@ int console_msg_log = 0;//[Ind] msg error logging
//
// \033[u - Restore cursor position (RCP)
// Restores the cursor position saved with the (SCP) sequence \033[s.
-// (addition, restore to 0,0 if nothinh was saved before)
+// (addition, restore to 0,0 if nothing was saved before)
//
// \033[#J - Erase Display (ED)
@@ -282,7 +282,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
}
//case '2': // not existing
//case '3': // blinking (not implemented)
- //case '4': // unterline (not implemented)
+ //case '4': // underline (not implemented)
//case '6': // not existing
//case '8': // concealed (not implemented)
//case '9': // not existing
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 5b32f39ae..8008acf5a 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -72,9 +72,9 @@
#define CL_XXBL "\033[0;44m" // default on blue
#define CL_PASS "\033[0;32;42m" // green on green
-#define CL_SPACE " " // space aquivalent of the print messages
+#define CL_SPACE " " // space equivalent of the print messages
-extern int stdout_with_ansisequence; //If the color ansi sequences are to be used. [flaviojs]
+extern int stdout_with_ansisequence; //If the color ANSI sequences are to be used. [flaviojs]
extern int msg_silent; //Specifies how silent the console is. [Skotlex]
extern int console_msg_log; //Specifies what error messages to log. [Ind]
extern char timestamp_format[20]; //For displaying Timestamps [Skotlex]
diff --git a/src/common/socket.c b/src/common/socket.c
index ac6be68fe..58c2d5bf9 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -360,7 +360,7 @@ int recv_to_fifo(int fd)
len = sRecv(fd, (char *) session[fd]->rdata + session[fd]->rdata_size, (int)RFIFOSPACE(fd), 0);
if( len == SOCKET_ERROR )
- {//An exception has occured
+ {//An exception has occurred
if( sErrno != S_EWOULDBLOCK ) {
//ShowDebug("recv_to_fifo: %s, closing connection #%d\n", error_msg(), fd);
set_eof(fd);
@@ -400,7 +400,7 @@ int send_from_fifo(int fd)
len = sSend(fd, (const char *) session[fd]->wdata, (int)session[fd]->wdata_size, MSG_NOSIGNAL);
if( len == SOCKET_ERROR )
- {//An exception has occured
+ {//An exception has occurred
if( sErrno != S_EWOULDBLOCK ) {
//ShowDebug("send_from_fifo: %s, ending connection #%d\n", error_msg(), fd);
#ifdef SHOW_SERVER_STATS
@@ -845,7 +845,7 @@ int do_sockets(int next)
session[i]->func_send(i);
if(session[i]->flag.eof) //func_send can't free a session, this is safe.
- { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex]
+ { //Finally, even if there is no data to parse, connections signaled eof should be closed, so we call parse_func [Skotlex]
session[i]->func_parse(i); //This should close the session immediately.
}
}
@@ -1234,7 +1234,7 @@ void socket_final(void)
if(session[i])
sockt->close(i);
- // session[0] のダミーデータを削除
+ // session[0]
aFree(session[0]->rdata);
aFree(session[0]->wdata);
aFree(session[0]);
@@ -1364,7 +1364,7 @@ void socket_init(void)
}
}
#elif defined(HAVE_SETRLIMIT) && !defined(CYGWIN)
- // NOTE: getrlimit and setrlimit have bogus behaviour in cygwin.
+ // NOTE: getrlimit and setrlimit have bogus behavior in cygwin.
// "Number of fds is virtually unlimited in cygwin" (sys/param.h)
{// set socket limit to FD_SETSIZE
struct rlimit rlp;
@@ -1405,7 +1405,7 @@ void socket_init(void)
socket_config_read(SOCKET_CONF_FILENAME);
- // initialise last send-receive tick
+ // initialize last send-receive tick
sockt->last_tick = time(NULL);
// session[0] is now currently used for disconnected sessions of the map server, and as such,
@@ -1458,7 +1458,7 @@ uint32 str2ip(const char* ip_str)
}
// Reorders bytes from network to little endian (Windows).
-// Neccessary for sending port numbers to the RO client until Gravity notices that they forgot ntohs() calls.
+// Necessary for sending port numbers to the RO client until Gravity notices that they forgot ntohs() calls.
uint16 ntows(uint16 netshort)
{
return ((netshort & 0xFF) << 8) | ((netshort & 0xFF00) >> 8);
diff --git a/src/common/spinlock.h b/src/common/spinlock.h
index 1c0825181..fe0da6669 100644
--- a/src/common/spinlock.h
+++ b/src/common/spinlock.h
@@ -4,7 +4,7 @@
//
// CAS based Spinlock Implementation
//
-// CamelCase names are choosen to be consistent with microsofts winapi
+// CamelCase names are chosen to be consistent with Microsoft's WinAPI
// which implements CriticalSection by this naming...
//
// Author: Florian Wilkemeyer <fw@f-ws.de>
diff --git a/src/common/sql.c b/src/common/sql.c
index ffc4d63ef..a562478ea 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -38,7 +38,7 @@ struct Sql {
// Column length receiver.
-// Takes care of the possible size missmatch between uint32 and unsigned long.
+// Takes care of the possible size mismatch between uint32 and unsigned long.
struct s_column_length {
uint32* out_length;
unsigned long length;
@@ -569,7 +569,7 @@ static void SqlStmt_P_ShowDebugTruncatedColumn(SqlStmt* self, size_t i)
Sql_P_ShowDebugMysqlFieldInfo("data - ", field->type, field->flags&UNSIGNED_FLAG, self->column_lengths[i].length, "");
column = &self->columns[i];
if( column->buffer_type == MYSQL_TYPE_STRING )
- Sql_P_ShowDebugMysqlFieldInfo("buffer - ", column->buffer_type, column->is_unsigned, column->buffer_length, "+1(nul-terminator)");
+ Sql_P_ShowDebugMysqlFieldInfo("buffer - ", column->buffer_type, column->is_unsigned, column->buffer_length, "+1(null-terminator)");
else
Sql_P_ShowDebugMysqlFieldInfo("buffer - ", column->buffer_type, column->is_unsigned, column->buffer_length, "");
mysql_free_result(meta);
@@ -765,10 +765,10 @@ int SqlStmt_BindColumn(SqlStmt* self, size_t idx, enum SqlDataType buffer_type,
{
if( buffer_len < 1 )
{
- ShowDebug("SqlStmt_BindColumn: buffer_len(%d) is too small, no room for the nul-terminator\n", buffer_len);
+ ShowDebug("SqlStmt_BindColumn: buffer_len(%d) is too small, no room for the null-terminator\n", buffer_len);
return SQL_ERROR;
}
- --buffer_len;// nul-terminator
+ --buffer_len;// null-terminator
}
if( !self->bind_columns )
{// initialize the bindings
@@ -891,7 +891,7 @@ int SqlStmt_NextRow(SqlStmt* self)
if( self->column_lengths[i].out_length )
*self->column_lengths[i].out_length = (uint32)length;
if( column->buffer_type == MYSQL_TYPE_STRING )
- {// clear unused part of the string/enum buffer (and nul-terminate)
+ {// clear unused part of the string/enum buffer (and null-terminate)
memset((char*)column->buffer + length, 0, column->buffer_length - length + 1);
}
else if( column->buffer_type == MYSQL_TYPE_BLOB && length < column->buffer_length )
diff --git a/src/common/sql.h b/src/common/sql.h
index 64d8307fc..3bdb76c74 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -166,7 +166,7 @@ struct sql_interface {
/// It uses the connection of the parent Sql handle.
/// Queries in Sql and SqlStmt are independent and don't affect each other.
///
- /// @return SqlStmt handle or NULL if an error occured
+ /// @return SqlStmt handle or NULL if an error occurred
struct SqlStmt* (*StmtMalloc)(Sql* sql);
@@ -198,7 +198,7 @@ struct sql_interface {
/// Returns the number of parameters in the prepared statement.
///
- /// @return Number or paramenters
+ /// @return Number or parameters
size_t (*StmtNumParams)(SqlStmt* self);
@@ -237,7 +237,7 @@ struct sql_interface {
/// Binds the result of a column to a buffer.
/// The buffer will be filled with data when the next row is fetched.
/// For string/enum buffer types there has to be enough space for the data
- /// and the nul-terminator (an extra byte).
+ /// and the null-terminator (an extra byte).
///
/// @return SQL_SUCCESS or SQL_ERROR
int (*StmtBindColumn)(SqlStmt* self, size_t idx, SqlDataType buffer_type, void* buffer, size_t buffer_len, uint32* out_length, int8* out_is_null);
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 10e893c3a..2ce8fd347 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -147,15 +147,15 @@ char* trim(char* str)
if( start == end )
*str = '\0';// empty string
else
- {// move string with nul terminator
+ {// move string with null-terminator
str[end] = '\0';
memmove(str,str+start,end-start+1);
}
return str;
}
-// Converts one or more consecutive occurences of the delimiters into a single space
-// and removes such occurences from the beginning and end of string
+// Converts one or more consecutive occurrences of the delimiters into a single space
+// and removes such occurrences from the beginning and end of string
// NOTE: make sure the string is not const!!
char* normalize_name(char* str,const char* delims)
{
@@ -358,18 +358,18 @@ int config_switch(const char* str) {
return (int)strtol(str, NULL, 0);
}
-/// strncpy that always nul-terminates the string
+/// strncpy that always null-terminates the string
char* safestrncpy(char* dst, const char* src, size_t n)
{
if( n > 0 )
{
char* d = dst;
const char* s = src;
- d[--n] = '\0';/* nul-terminate string */
+ d[--n] = '\0';/* null-terminate string */
for( ; n > 0; --n )
{
if( (*d++ = *s++) == '\0' )
- {/* nul-pad remaining bytes */
+ {/* null-pad remaining bytes */
while( --n > 0 )
*d++ = '\0';
break;
@@ -385,12 +385,12 @@ size_t safestrnlen(const char* string, size_t maxlen)
return ( string != NULL ) ? strnlen(string, maxlen) : 0;
}
-/// Works like snprintf, but always nul-terminates the buffer.
-/// Returns the size of the string (without nul-terminator)
+/// Works like snprintf, but always null-terminates the buffer.
+/// Returns the size of the string (without null-terminator)
/// or -1 if the buffer is too small.
///
/// @param buf Target buffer
-/// @param sz Size of the buffer (including nul-terminator)
+/// @param sz Size of the buffer (including null-terminator)
/// @param fmt Format string
/// @param ... Format arguments
/// @return The size of the string or -1 if the buffer is too small
@@ -404,7 +404,7 @@ int safesnprintf(char* buf, size_t sz, const char* fmt, ...)
va_end(ap);
if( ret < 0 || (size_t)ret >= sz )
{// overflow
- buf[sz-1] = '\0';// always nul-terminate
+ buf[sz-1] = '\0';// always null-terminate
return -1;
}
return ret;
@@ -631,8 +631,8 @@ int sv_parse_next(struct s_svstate* svstate)
/// @param delim Field delimiter
/// @param out_pos Array of resulting positions
/// @param npos Size of the pos array
-/// @param opt Options that determine the parsing behaviour
-/// @return Number of fields found in the string or -1 if an error occured
+/// @param opt Options that determine the parsing behavior
+/// @return Number of fields found in the string or -1 if an error occurred
int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, int npos, enum e_svopt opt) {
struct s_svstate svstate;
int count;
@@ -666,11 +666,11 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i
/// WARNING: this function modifies the input string
/// Starts splitting at startoff and fills the out_fields array.
/// out_fields[0] is the start of the next line.
-/// Other entries are the start of fields (nul-teminated).
+/// Other entries are the start of fields (null-terminated).
/// Returns the number of fields found or -1 if an error occurs.
///
/// out_fields can be NULL.
-/// Fields that don't fit in out_fields are not nul-terminated.
+/// Fields that don't fit in out_fields are not null-terminated.
/// Extra entries in out_fields are filled with the end of the last field (empty string).
///
/// @param str String to parse
@@ -679,8 +679,8 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i
/// @param delim Field delimiter
/// @param out_fields Array of resulting fields
/// @param nfields Size of the field array
-/// @param opt Options that determine the parsing behaviour
-/// @return Number of fields found in the string or -1 if an error occured
+/// @param opt Options that determine the parsing behavior
+/// @return Number of fields found in the string or -1 if an error occurred
int sv_split(char* str, int len, int startoff, char delim, char** out_fields, int nfields, enum e_svopt opt) {
int pos[1024];
int i;
diff --git a/src/common/strlib.h b/src/common/strlib.h
index f93d8ad67..f39f27789 100644
--- a/src/common/strlib.h
+++ b/src/common/strlib.h
@@ -16,7 +16,7 @@
char *_strtok_r(char* s1, const char* s2, char** lasts);
#endif
-/// Bitfield determining the behaviour of sv_parse and sv_split.
+/// Bitfield determining the behavior of sv_parse and sv_split.
typedef enum e_svopt {
// default: no escapes and no line terminator
SV_NOESCAPE_NOTERMINATE = 0,
@@ -73,14 +73,14 @@ struct strlib_interface {
int (*e_mail_check) (char* email);
int (*config_switch) (const char* str);
- /// strncpy that always nul-terminates the string
+ /// strncpy that always null-terminates the string
char *(*safestrncpy) (char* dst, const char* src, size_t n);
/// doesn't crash on null pointer
size_t (*safestrnlen) (const char* string, size_t maxlen);
- /// Works like snprintf, but always nul-terminates the buffer.
- /// Returns the size of the string (without nul-terminator)
+ /// Works like snprintf, but always null-terminates the buffer.
+ /// Returns the size of the string (without null-terminator)
/// or -1 if the buffer is too small.
int (*safesnprintf) (char* buf, size_t sz, const char* fmt, ...);
@@ -131,7 +131,7 @@ struct sv_interface {
/// WARNING: this function modifies the input string
/// Starts splitting at startoff and fills the out_fields array.
/// out_fields[0] is the start of the next line.
- /// Other entries are the start of fields (nul-teminated).
+ /// Other entries are the start of fields (null-terminated).
/// Returns the number of fields found or -1 if an error occurs.
int (*split) (char* str, int len, int startoff, char delim, char** out_fields, int nfields, enum e_svopt opt);
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 3fdfadb41..40ef6cfc0 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -226,7 +226,7 @@ bool sysinfo_svn_get_revision(char **out) {
// - since it's a cache column, the data might not even exist
if ((fp = fopen(".svn"PATHSEP_STR"wc.db", "rb")) != NULL || (fp = fopen(".."PATHSEP_STR".svn"PATHSEP_STR"wc.db", "rb")) != NULL) {
-#ifndef SVNNODEPATH //not sure how to handle branches, so i'll leave this overridable define until a better solution comes up
+#ifndef SVNNODEPATH //not sure how to handle branches, so I'll leave this overridable define until a better solution comes up
#define SVNNODEPATH trunk
#endif // SVNNODEPATH
@@ -709,7 +709,7 @@ void sysinfo_vcsrevision_src_retrieve(void) {
#endif // WIN32
/**
- * Retrieevs the VCS type name.
+ * Retrieves the VCS type name.
*
* Once retrieved, the value is stored in sysinfo->p->vcstype_name.
*/
diff --git a/src/common/thread.c b/src/common/thread.c
index 91360537f..4be37d576 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -68,7 +68,7 @@ void rathread_init(){
l_threads[i].myID = i;
}
- // now lets init thread id 0, which represnts the main thread
+ // now lets init thread id 0, which represents the main thread
#ifdef HAS_TLS
g_rathread_ID = 0;
#endif
@@ -83,7 +83,7 @@ void rathread_final(){
register unsigned int i;
// Unterminated Threads Left?
- // Should'nt happen ..
+ // Shouldn't happen ..
// Kill 'em all!
//
for(i = 1; i < RA_THREADS_MAX; i++){
@@ -121,9 +121,9 @@ static void *_raThreadMainRedirector( void *p ){
#ifndef WIN32
// When using posix threads
- // the threads inherits the Signal mask from the thread which's spawned
+ // the threads inherits the Signal mask from the thread which spawned
// this thread
- // so we've to block everything we dont care about.
+ // so we've to block everything we don't care about.
sigemptyset(&set);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGTERM);
@@ -222,10 +222,10 @@ void rathread_destroy ( rAthread handle ){
#else
if( pthread_cancel( handle->hThread ) == 0){
- // We have to join it, otherwise pthread wont re-cycle its internal ressources assoc. with this thread.
+ // We have to join it, otherwise pthread wont re-cycle its internal resources assoc. with this thread.
pthread_join( handle->hThread, NULL );
- // Tell our manager to release ressources ;)
+ // Tell our manager to release resources ;)
rat_thread_terminated(handle);
}
#endif
@@ -265,7 +265,7 @@ int rathread_get_tid(){
#ifdef HAS_TLS
return g_rathread_ID;
#else
- // todo
+ // TODO
#ifdef WIN32
return (int)GetCurrentThreadId();
#else
diff --git a/src/common/thread.h b/src/common/thread.h
index 7ad326509..992e3e6c8 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -20,7 +20,7 @@ typedef enum RATHREAD_PRIO {
* Creates a new Thread
*
* @param entyPoint - entryProc,
- * @param param - general purpose parameter, would be given as parameter to the thread's entrypoint.
+ * @param param - general purpose parameter, would be given as parameter to the thread's entry point.
*
* @return not NULL if success
*/
@@ -31,7 +31,7 @@ rAthread rathread_create( rAthreadProc entryPoint, void *param );
* Creates a new Thread (with more creation options)
*
* @param entyPoint - entryProc,
- * @param param - general purpose parameter, would be given as parameter to the thread's entrypoint
+ * @param param - general purpose parameter, would be given as parameter to the thread's entry point
* @param szStack - stack Size in bytes
* @param prio - Priority of the Thread @ OS Scheduler..
*
@@ -41,9 +41,9 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta
/**
- * Destroys the given Thread immediatly
+ * Destroys the given Thread immediately
*
- * @note The Handle gets invalid after call! dont use it afterwards.
+ * @note The Handle gets invalid after call! don't use it afterwards.
*
* @param handle - thread to destroy.
*/
@@ -53,7 +53,7 @@ void rathread_destroy ( rAthread handle );
/**
* Returns the thread handle of the thread calling this function
*
- * @note this wont work @ programms main thread
+ * @note this wont work @ programs main thread
* @note the underlying implementation might not perform very well, cache the value received!
*
* @return not NULL if success
@@ -62,10 +62,10 @@ rAthread rathread_self( );
/**
- * Returns own thrad id (TID)
+ * Returns own thread id (TID)
*
* @note this is an unique identifier for the calling thread, and
- * depends on platfrom / compiler, and may not be the systems Thread ID!
+ * depends on platform/ compiler, and may not be the systems Thread ID!
*
* @return -1 when fails, otherwise >= 0
*/
@@ -93,7 +93,7 @@ void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio );
/**
- * Gets the current Prio of the given trhead
+ * Gets the current Prio of the given thread
*
* @param handle - the thread to get the prio for.
*/
diff --git a/src/common/timer.c b/src/common/timer.c
index 5240ec202..ab0471d51 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -170,14 +170,14 @@ static int64 sys_tick(void) {
}
if (pGetTickCount64)
return (int64)pGetTickCount64();
- // 32-bit fallback. Note: This will wrap around every ~49 days since system startup!!!
+ // 32-bit fall back. Note: This will wrap around every ~49 days since system startup!!!
return (int64)GetTickCount();
#elif defined(ENABLE_RDTSC)
// RDTSC: Returns the number of CPU cycles since reset. Unreliable if
// the CPU frequency is variable.
return (int64)((_rdtsc() - RDTSC_BEGINTICK) / RDTSC_CLOCK);
#elif defined(HAVE_MONOTONIC_CLOCK)
- // Monotinic clock: Implementation-defined.
+ // Monotonic clock: Implementation-defined.
// Clock that cannot be set and represents monotonic time since some
// unspecified starting point. This clock is not affected by
// discontinuous jumps in the system time (e.g., if the system
@@ -188,7 +188,7 @@ static int64 sys_tick(void) {
// int64 cast to avoid overflows on platforms where time_t is 32 bit
return (int64)tval.tv_sec * 1000 + tval.tv_nsec / 1000000;
#else
- // Fallback, regular clock: Number of milliseconds since epoch.
+ // Fall back, regular clock: Number of milliseconds since epoch.
// The time returned by gettimeofday() is affected by discontinuous
// jumps in the system time (e.g., if the system administrator
// manually changes the system time). If you need a monotonically
diff --git a/src/common/utils.c b/src/common/utils.c
index 80954f848..4e6cb49c2 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -200,7 +200,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
sprintf(tmppath,"%s%c%s",path, PATHSEP, entry->d_name);
- // check if the pattern matchs.
+ // check if the pattern matches.
if (entry->d_name && strstr(entry->d_name, pattern)) {
func( tmppath );
}
@@ -211,7 +211,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
}
// is this a directory?
if (S_ISDIR(dir_stat.st_mode)) {
- // decent recursivly
+ // decent recursively
findfile(tmppath, pat, func);
}
}//end while
@@ -326,7 +326,7 @@ unsigned int get_percentage(const unsigned int A, const unsigned int B)
if( B == 0 )
{
- ShowError("get_percentage(): divison by zero! (A=%u,B=%u)\n", A, B);
+ ShowError("get_percentage(): division by zero! (A=%u,B=%u)\n", A, B);
return ~0U;
}