Skip to content

Commit

Permalink
Remove extraneous whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
vlovich committed Oct 21, 2022
1 parent 79f4ee1 commit e81e746
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions include/coz.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ typedef coz_counter_t* (*coz_get_counter_t)(int, const char*);
static coz_counter_t* _call_coz_get_counter(int type, const char* name) {
static unsigned char _initialized = 0;
static coz_get_counter_t fn; // The pointer to _coz_get_counter

if(!_initialized) {
if(dlsym) {
// Locate the _coz_get_counter method
void* p = dlsym(RTLD_DEFAULT, "_coz_get_counter");

// Use memcpy to avoid pedantic GCC complaint about storing function pointer in void*
memcpy(&fn, &p, sizeof(p));
}

_initialized = 1;
}

// Call the function, or return null if profiler is not found
if(fn) return fn(type, name);
else return 0;
Expand All @@ -77,7 +77,7 @@ static coz_counter_t* _call_coz_get_counter(int type, const char* name) {
} \
}

#define STR2(x) #x
#define STR2(x) #x
#define STR(x) STR2(x)

#define COZ_PROGRESS_NAMED(name) COZ_INCREMENT_COUNTER(COZ_COUNTER_TYPE_THROUGHPUT, name)
Expand Down
6 changes: 3 additions & 3 deletions libcoz/libcoz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ extern "C" coz_counter_t* _coz_get_counter(progress_point_type t, const char* na
throughput_point* p = profiler::get_instance().get_throughput_point(name);
if(p) return p->get_counter_struct();
else return nullptr;

} else if(t == progress_point_type::begin) {
latency_point* p = profiler::get_instance().get_latency_point(name);
if(p) return p->get_begin_counter_struct();
else return nullptr;

} else if(t == progress_point_type::end) {
latency_point* p = profiler::get_instance().get_latency_point(name);
if(p) return p->get_end_counter_struct();
else return nullptr;

} else {
WARNING << "Unknown progress point type " << ((int)t) << " named " << name;
return nullptr;
Expand Down

0 comments on commit e81e746

Please sign in to comment.