kfdtest: Style cleanup

Clean up the KFDTest style via CPPLint. Some warnings remain regarding
volatile variables being cast to void*. This is the command used:
cpplint.py --linelength=120
--filter=-readability/multiline_string,-readability/todo,-build/include,-runtime/references

multiline_string is due to using ISA code
todo is to avoid errors that we don't have TODO(username) instead of TODO
include is about including the folder in the header includes
references is regarding non-const references '&' being const or using
pointers. That can be addressed later

Change-Id: I3c6622da0a13dd33ab29b2bfff48be25e763b750
Este commit está contenido en:
Kent Russell
2018-08-13 09:03:31 -04:00
padre 3f7b6356fd
commit dffac0a97e
Se han modificado 33 ficheros con 371 adiciones y 328 borrados
+7 -5
Ver fichero
@@ -41,7 +41,9 @@
#include <sys/ioctl.h>
#include <sys/time.h>
static int protection_flags[8] = {int(PROT_NONE), int(PROT_READ), int(PROT_WRITE), int(PROT_READ | PROT_WRITE), int(PROT_EXEC), int(PROT_EXEC | PROT_READ), int(PROT_EXEC | PROT_WRITE), int(PROT_EXEC | PROT_WRITE | PROT_READ)};
static int protection_flags[8] = {PROT_NONE, PROT_READ, PROT_WRITE, PROT_READ | PROT_WRITE,
PROT_EXEC, PROT_EXEC | PROT_READ, PROT_EXEC | PROT_WRITE,
PROT_EXEC | PROT_WRITE | PROT_READ};
void SetConsoleTextColor(TEXTCOLOR color) {
// TODO complete
@@ -69,8 +71,8 @@ bool VirtualFreeMemory(void *address, unsigned int size) {
return false;
}
unsigned long GetLastErrorNo() {
return errno;
HSAuint64 GetLastErrorNo() {
return errno;
}
bool MultiProcessTest(const char *testToRun, int numOfProcesses, int runsPerProcess) {
@@ -78,7 +80,7 @@ bool MultiProcessTest(const char *testToRun, int numOfProcesses, int runsPerProc
return false;
}
unsigned long long GetSystemTickCountInMicroSec() {
HSAuint64 GetSystemTickCountInMicroSec() {
struct timeval t;
gettimeofday(&t, 0);
return t.tv_sec * 1000000ULL + t.tv_usec;
@@ -229,7 +231,7 @@ bool WaitForThread(uint64_t threadId) {
return 0 == pthread_join((pthread_t)threadId, NULL);
}
long AtomicInc(volatile long* pValue) {
HSAint64 AtomicInc(volatile HSAint64* pValue) {
return __sync_add_and_fetch(pValue, 1);
}