From 224aee3ffc83a306629696fe4cf45cad9efa4349 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 17 Jan 2008 14:04:06 +0000 Subject: [PATCH] sem.c -> sem.cpp, port.c -> port.cpp git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23585 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/Jamfile | 4 ++-- src/system/kernel/{port.c => port.cpp} | 8 ++++---- src/system/kernel/{sem.c => sem.cpp} | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/system/kernel/{port.c => port.cpp} (99%) rename src/system/kernel/{sem.c => sem.cpp} (99%) diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile index 2f14eabd97..36797a187c 100644 --- a/src/system/kernel/Jamfile +++ b/src/system/kernel/Jamfile @@ -29,10 +29,10 @@ KernelMergeObject kernel_core.o : main.c module.cpp Notifications.cpp - port.c + port.cpp real_time_clock.c scheduler.cpp - sem.c + sem.cpp shutdown.c signal.cpp system_info.c diff --git a/src/system/kernel/port.c b/src/system/kernel/port.cpp similarity index 99% rename from src/system/kernel/port.c rename to src/system/kernel/port.cpp index bb8054def8..2523349955 100644 --- a/src/system/kernel/port.c +++ b/src/system/kernel/port.cpp @@ -840,7 +840,7 @@ port_buffer_size_etc(port_id id, uint32 flags, bigtime_t timeout) } // determine tail & get the length of the message - msg = list_get_first_item(&sPorts[slot].msg_queue); + msg = (port_msg*)list_get_first_item(&sPorts[slot].msg_queue); if (msg == NULL) { if (status == B_OK) panic("port %ld: no messages found\n", sPorts[slot].id); @@ -970,7 +970,7 @@ read_port_etc(port_id id, int32 *_msgCode, void *msgBuffer, size_t bufferSize, return B_BAD_PORT_ID; } - msg = list_get_first_item(&sPorts[slot].msg_queue); + msg = (port_msg*)list_get_first_item(&sPorts[slot].msg_queue); if (msg == NULL) { if (status == B_OK) panic("port %ld: no messages found", sPorts[slot].id); @@ -993,7 +993,7 @@ read_port_etc(port_id id, int32 *_msgCode, void *msgBuffer, size_t bufferSize, restore_interrupts(state); // check output buffer size - size = min(bufferSize, msg->size); + size = min_c(bufferSize, msg->size); // copy message if (_msgCode != NULL) @@ -1367,7 +1367,7 @@ _user_writev_port_etc(port_id port, int32 messageCode, const iovec *userVecs, return B_BAD_ADDRESS; if (userVecs && vecCount != 0) { - vecs = malloc(sizeof(iovec) * vecCount); + vecs = (iovec*)malloc(sizeof(iovec) * vecCount); if (vecs == NULL) return B_NO_MEMORY; diff --git a/src/system/kernel/sem.c b/src/system/kernel/sem.cpp similarity index 99% rename from src/system/kernel/sem.c rename to src/system/kernel/sem.cpp index de508e8d3a..22a5d5f06e 100644 --- a/src/system/kernel/sem.c +++ b/src/system/kernel/sem.cpp @@ -422,7 +422,7 @@ create_sem_etc(int32 count, const char *name, team_id owner) name = "unnamed semaphore"; nameLength = strlen(name) + 1; - nameLength = min(nameLength, B_OS_NAME_LENGTH); + nameLength = min_c(nameLength, B_OS_NAME_LENGTH); tempName = (char *)malloc(nameLength); if (tempName == NULL) return B_NO_MEMORY; @@ -604,7 +604,7 @@ remove_thread_from_sem(struct thread *thread, struct sem_entry *sem, // now see if more threads need to be woken up while (sem->u.used.count > 0 && thread_lookat_queue(&sem->u.used.queue) != NULL) { - int32 delta = min(thread->sem.count, sem->u.used.count); + int32 delta = min_c(thread->sem.count, sem->u.used.count); thread->sem.count -= delta; if (thread->sem.count <= 0) { @@ -863,7 +863,7 @@ switch_sem_etc(sem_id semToBeReleased, sem_id id, int32 count, thread->sem.flags = flags; thread->sem.blocking = id; thread->sem.acquire_count = count; - thread->sem.count = min(-sSems[slot].u.used.count, count); + thread->sem.count = min_c(-sSems[slot].u.used.count, count); // store the count we need to restore upon release thread->sem.acquire_status = B_NO_ERROR; thread_enqueue(thread, &sSems[slot].u.used.queue); @@ -1025,7 +1025,7 @@ release_sem_etc(sem_id id, int32 count, uint32 flags) if (sSems[slot].u.used.count < 0) { struct thread *thread = thread_lookat_queue(&sSems[slot].u.used.queue); - delta = min(count, thread->sem.count); + delta = min_c(count, thread->sem.count); thread->sem.count -= delta; if (thread->sem.count <= 0) { // release this thread