Skip to content

Commit

Permalink
[MOD] fix codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tsymiar committed Sep 21, 2024
1 parent 0791264 commit baf45fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash
BIN=$(pwd)/build
if [ "${1}" == "clean" ]; then
rm -rvf ${BIN}
rm -rvf "${BIN}"
else
if [ ! -d ${BIN} ]; then mkdir ${BIN}; fi;
g++ main.cpp -o ${BIN}/gn -std=c++11 -lpthread
if [ ! -d "${BIN}" ]; then
mkdir "${BIN}"
fi
g++ main.cpp -o "${BIN}/gn" -std=c++11 -lpthread
fi
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void gettimeofday(struct timeval* tp, struct timezone* tzp)
tp->tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
}
static void usleep(unsigned long usec)
static void ussleep(unsigned long usec)
{
LARGE_INTEGER interval;
interval.QuadPart = -long(10 * usec);
Expand All @@ -60,7 +60,7 @@ struct Runtime {

namespace {
const char* g_file = "test";
uint64_t g_total = 1048576;
uint64_t g_total = 0x100000;
int g_bits = 32;
bool g_decrease = 0;
int g_endian = 0;
Expand Down Expand Up @@ -117,7 +117,7 @@ int main(int argc, char* argv[])
std::thread task(
[&]()->void {
while (true) {
msleep(100);
msleep(10);
if (!g_runtime.kmg) {
continue;
}
Expand Down Expand Up @@ -365,7 +365,7 @@ void parse_args(int argc, char** argv)
void msleep(unsigned long ms)
{
#if (defined _WIN32) && (!defined __GNUC__)
usleep(1000 * ms);
ussleep(ms * 1000);
#else
struct timespec ts = {
.tv_sec = static_cast<long>(ms / 1000),
Expand Down

0 comments on commit baf45fc

Please sign in to comment.