mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-03 03:16:01 -04:00
more fixes
This commit is contained in:
@@ -46,8 +46,6 @@ ClockStamp Clock::getCurTime()
|
||||
return ret;
|
||||
#else
|
||||
struct timeval tv;
|
||||
int err;
|
||||
err = gettimeofday(&tv, NULL);
|
||||
return (static_cast<ClockStamp>(tv.tv_sec) * 1000 + static_cast<ClockStamp>(tv.tv_usec / 1000));
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ inline int UpperHashString(char *string)
|
||||
int h = 0;
|
||||
while (*string != 0)
|
||||
{
|
||||
h = ((31 * h) + ((*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string) ^ (h >> 26));
|
||||
h = ((31 * h) + (((*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string) ^ (h >> 26)));
|
||||
string++;
|
||||
}
|
||||
return(h);
|
||||
|
||||
@@ -82,7 +82,7 @@ unsigned int FilterWithBufferedInput::BlockQueue::GetAll(byte *outString)
|
||||
void FilterWithBufferedInput::BlockQueue::Put(const byte *inString, unsigned int length)
|
||||
{
|
||||
assert(m_size + length <= m_buffer.size);
|
||||
byte *end = (m_size < m_buffer+m_buffer.size-m_begin) ? m_begin + m_size : m_begin + m_size - m_buffer.size;
|
||||
byte *end = (m_size < (unsigned)(m_buffer+m_buffer.size-m_begin)) ? m_begin + m_size : m_begin + m_size - m_buffer.size;
|
||||
unsigned int len = STDMIN(length, (unsigned int)(m_buffer+m_buffer.size-end));
|
||||
memcpy(end, inString, len);
|
||||
if (len < length)
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace Archive
|
||||
template <> void AutoDeltaPackedMap<int, Unicode::String>::pack(ByteStream & target, const std::string & buffer)
|
||||
{
|
||||
char temp[200];
|
||||
char valueBuffer[200];
|
||||
Command c;
|
||||
|
||||
Archive::put(target, countCharacter(buffer,':'));
|
||||
@@ -31,7 +30,6 @@ namespace Archive
|
||||
if (*i==':')
|
||||
{
|
||||
temp[tempPos]='\0';
|
||||
valueBuffer[0]='\0';
|
||||
sscanf(temp,"%i",&c.key);
|
||||
char const * const valueStart = strchr(temp,' ');
|
||||
if (valueStart)
|
||||
|
||||
Reference in New Issue
Block a user