Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix thread arg type for pthread_setname_np #237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cen64.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ int run_device(struct cen64_device *device, bool no_video) {
}

CEN64_THREAD_RETURN_TYPE run_device_thread(void *opaque) {
cen64_thread_setname(NULL, "device");
cen64_thread_setname((cen64_thread)NULL, "device");
struct cen64_device *device = (struct cen64_device *) opaque;

device_run(device);
Expand Down
4 changes: 2 additions & 2 deletions device/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ CEN64_THREAD_RETURN_TYPE run_rcp_thread(void *opaque) {
}

CEN64_THREAD_RETURN_TYPE run_vr4300_thread(void *opaque) {
cen64_thread_setname(NULL, "vr4300");
cen64_thread_setname((cen64_thread)NULL, "vr4300");
struct cen64_device *device = (struct cen64_device *) opaque;

while (likely(device->running)) {
Expand Down Expand Up @@ -351,4 +351,4 @@ int device_debug_spin(struct cen64_device *device) {

cen64_cold void device_connect_debugger(struct cen64_device *device, void* break_handler_data, vr4300_debug_break_handler break_handler) {
vr4300_connect_debugger(device->vr4300, break_handler_data, break_handler);
}
}
4 changes: 2 additions & 2 deletions gdb/gdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool gdb_parse_packet(const char* input, int len, const char** command_start, co
}

CEN64_THREAD_RETURN_TYPE gdb_thread(void *opaque) {
cen64_thread_setname(NULL, "gdb");
cen64_thread_setname((cen64_thread)NULL, "gdb");
struct gdb *gdb = (struct gdb *) opaque;

cen64_mutex_lock(&gdb->client_mutex);
Expand Down Expand Up @@ -257,4 +257,4 @@ cen64_cold void gdb_destroy(struct gdb* gdb) {

gdb->device = NULL;
free(gdb);
}
}
6 changes: 3 additions & 3 deletions os/posix/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ static inline int cen64_thread_join(cen64_thread *t) {
#ifdef __APPLE__
int pthread_setname_np(const char*);
#elif __NETBSD__
int pthread_setname_np(cen64_thread*, const char*, const char*);
int pthread_setname_np(cen64_thread, const char*, const char*);
#else
int pthread_setname_np(cen64_thread*, const char*);
int pthread_setname_np(cen64_thread, const char*);
#endif

// Sets the name of the thread to a specific value
Expand All @@ -56,7 +56,7 @@ int pthread_setname_np(cen64_thread*, const char*);
// If you call it at the wrong time or your OS doesn't support custom thread names
// the return value will be non-zero.
// If cen64_thread is not set the name of the current thread will be changed.
static inline int cen64_thread_setname(cen64_thread *t, const char *name) {
static inline int cen64_thread_setname(cen64_thread t, const char *name) {
#ifdef __APPLE__
if (t == NULL)
return pthread_setname_np(name);
Expand Down
2 changes: 1 addition & 1 deletion os/winapi/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static inline int cen64_thread_join(cen64_thread *t) {
//
// Windows isn't supported for the moment.
//
static inline int cen64_thread_setname(cen64_thread *t, const char *name) {
static inline int cen64_thread_setname(cen64_thread t, const char *name) {
return ENOSYS;
}

Expand Down