Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed the pid_t type for Win32/64 so that it is an integral type whic…

…h can be typecasted to/from an integer value. Also added a few typecasts in the code to remove a couple of compiler warnings related to this issue.
  • Loading branch information...
commit 339f9c47536d0a0294f8ca70321ba0e5e745ec17 1 parent 06f5bb1
Ger Hobbelt authored
Showing with 15 additions and 19 deletions.
  1. +1 −5 sched.h
  2. +7 −7 sched_getscheduler.c
  3. +7 −7 sched_setscheduler.c
6 sched.h
View
@@ -129,11 +129,7 @@
/* [i_a] fix for using pthread_win32 with mongoose code, which #define's its own pid_t akin to typedef HANDLE pid_t; */
#undef pid_t
# if defined(_MSC_VER)
- typedef struct
- {
- int i;
- void *p;
- } pid_t;
+ typedef void *pid_t;
# else
typedef int pid_t;
# endif
14 sched_getscheduler.c
View
@@ -1,6 +1,6 @@
/*
* sched_getscheduler.c
- *
+ *
* Description:
* POSIX thread functions that deal with thread scheduling.
*
@@ -9,25 +9,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -48,7 +48,7 @@ sched_getscheduler (pid_t pid)
*/
if (0 != pid)
{
- int selfPid = (int) GetCurrentProcessId ();
+ pid_t selfPid = (pid_t) GetCurrentProcessId ();
if (pid != selfPid)
{
14 sched_setscheduler.c
View
@@ -1,6 +1,6 @@
/*
* sched_setscheduler.c
- *
+ *
* Description:
* POSIX thread functions that deal with thread scheduling.
*
@@ -9,25 +9,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors
- *
+ *
* Contact Email: rpj@callisto.canberra.edu.au
- *
+ *
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
@@ -50,7 +50,7 @@ sched_setscheduler (pid_t pid, int policy)
*/
if (0 != pid)
{
- int selfPid = (int) GetCurrentProcessId ();
+ pid_t selfPid = (pid_t) GetCurrentProcessId ();
if (pid != selfPid)
{
Please sign in to comment.
Something went wrong with that request. Please try again.