Skip to content

Commit

Permalink
Added some minor change, mostly stylistic
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1arm committed Feb 12, 2025
1 parent d55b68a commit df3bdb4
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/shared/Common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,31 @@
#ifdef PACKAGE
#undef PACKAGE
#endif // PACKAGE

#ifdef PACKAGE_BUGREPORT
#undef PACKAGE_BUGREPORT
#endif // PACKAGE_BUGREPORT

#ifdef PACKAGE_NAME
#undef PACKAGE_NAME
#endif // PACKAGE_NAME

#ifdef PACKAGE_STRING
#undef PACKAGE_STRING
#endif // PACKAGE_STRING

#ifdef PACKAGE_TARNAME
#undef PACKAGE_TARNAME
#endif // PACKAGE_TARNAME

#ifdef PACKAGE_VERSION
#undef PACKAGE_VERSION
#endif // PACKAGE_VERSION

#ifdef VERSION
#undef VERSION
#endif // VERSION

#undef PACKAGE
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
Expand All @@ -65,6 +72,7 @@
# pragma warning(disable:4244) // 'argument' : conversion from 'type1' to 'type2', possible loss of data
# pragma warning(disable:4355) // 'this' : used in base member initializer list
#endif // __SHOW_STUPID_WARNINGS__

#endif // __GNUC__

#include "Utilities/UnorderedMapSet.h"
Expand Down
6 changes: 3 additions & 3 deletions src/shared/Config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ bool Config::GetBoolDefault(const char* name, bool def)
if (strcmp(str, "true") == 0 || strcmp(str, "TRUE") == 0 ||
strcmp(str, "yes") == 0 || strcmp(str, "YES") == 0 ||
strcmp(str, "1") == 0)
{
return true;
}
{
return true;
}
else
{
return false;
Expand Down
21 changes: 21 additions & 0 deletions src/shared/Utilities/ByteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@

class ObjectGuid;

/**
* @brief
*
*/
class ByteBufferException
{
public:
Expand Down Expand Up @@ -721,6 +725,11 @@ class ByteBuffer
_rpos = wpos();
}

/**
* @brief
*
* @return size_t
*/
size_t wpos() const { return _wpos; }

/**
Expand Down Expand Up @@ -779,7 +788,14 @@ class ByteBuffer
{
throw ByteBufferException(false, pos, sizeof(T), size());
}
#if defined(__arm__)
// ARM has alignment issues, we need to use memcpy to avoid them
T val;
memcpy((void*)&val, (void*)&_storage[pos], sizeof(T));
#else
T val = *((T const*)&_storage[pos]);
#endif

EndianConvert(val);
return val;
}
Expand Down Expand Up @@ -920,6 +936,11 @@ class ByteBuffer
return f;
}

/**
* @brief
*
* @return const uint8
*/
const uint8* contents() const { return &_storage[0]; }

/**
Expand Down
4 changes: 4 additions & 0 deletions src/shared/Utilities/ProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void BarGoLink::init(int row_count)
#else
printf("[");
#endif

for (int i = 0; i < indic_len; ++i)
{
printf(empty);
Expand All @@ -78,6 +79,7 @@ void BarGoLink::init(int row_count)
#else
printf("] 0%%\r[");
#endif

fflush(stdout);
}

Expand All @@ -103,6 +105,7 @@ void BarGoLink::step()
#else
printf("\r[");
#endif

for (i = 0; i < n; ++i)
{
printf(full);
Expand All @@ -117,6 +120,7 @@ void BarGoLink::step()
#else
printf("] %i%% \r[", (int)percent);
#endif

fflush(stdout);

rec_pos = n;
Expand Down
1 change: 1 addition & 0 deletions src/shared/Win/ServiceWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#else
#define WINADVAPI
#endif

#endif

extern int main(int argc, char** argv);
Expand Down
1 change: 1 addition & 0 deletions src/shared/Win/ServiceWin32.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ bool WinServiceUninstall();
bool WinServiceRun();

#endif // _WIN32_SERVICE_

#endif // WIN32
3 changes: 3 additions & 0 deletions src/shared/Win/WheatyExceptionReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ void WheatyExceptionReport::GenerateExceptionReport(
pExceptionRecord->ExceptionAddress,
section, offset, szFaultingModule);
#endif

#ifdef _M_X64
_tprintf(_T("Fault address: %016I64X %02X:%016I64X %s\r\n"),
pExceptionRecord->ExceptionAddress,
Expand Down Expand Up @@ -639,9 +640,11 @@ void WheatyExceptionReport::WriteStackDetails(
#ifdef _M_IX86
_tprintf(_T("%04X:%08X %s"), section, offset, szModule);
#endif

#ifdef _M_X64
_tprintf(_T("%04X:%016I64X %s"), section, offset, szModule);
#endif

}

// Get the source line for this stack frame entry
Expand Down

0 comments on commit df3bdb4

Please sign in to comment.