summaryrefslogtreecommitdiff
path: root/psutil
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-10-18 01:22:54 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2016-10-18 01:22:54 +0200
commitd0a81e6bd5bb963476b1b0eb32f9a7f3e6949d7f (patch)
tree067076bf8351e6b6817ad715eb02b82970651533 /psutil
parentbf15b4c8e2656a98bc90e247adce4b801590479d (diff)
downloadpsutil-d0a81e6bd5bb963476b1b0eb32f9a7f3e6949d7f.tar.gz
fix compilation warns on OSX
Diffstat (limited to 'psutil')
-rw-r--r--psutil/_psutil_osx.c13
-rw-r--r--psutil/arch/osx/process_info.c4
-rw-r--r--psutil/arch/osx/process_info.h2
3 files changed, 10 insertions, 9 deletions
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c
index bdd7c559..cf9eda6d 100644
--- a/psutil/_psutil_osx.c
+++ b/psutil/_psutil_osx.c
@@ -813,11 +813,12 @@ psutil_cpu_times(PyObject *self, PyObject *args) {
static PyObject *
psutil_per_cpu_times(PyObject *self, PyObject *args) {
natural_t cpu_count;
+ natural_t i;
processor_info_array_t info_array;
mach_msg_type_number_t info_count;
kern_return_t error;
processor_cpu_load_info_data_t *cpu_load_info = NULL;
- int i, ret;
+ int ret;
PyObject *py_retlist = PyList_New(0);
PyObject *py_cputime = NULL;
@@ -1036,7 +1037,7 @@ psutil_proc_status(PyObject *self, PyObject *args) {
static PyObject *
psutil_proc_threads(PyObject *self, PyObject *args) {
long pid;
- int err, j, ret;
+ int err, ret;
kern_return_t kr;
unsigned int info_count = TASK_BASIC_INFO_COUNT;
mach_port_t task = MACH_PORT_NULL;
@@ -1044,7 +1045,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
thread_act_port_array_t thread_list = NULL;
thread_info_data_t thinfo_basic;
thread_basic_info_t basic_info_th;
- mach_msg_type_number_t thread_count, thread_info_count;
+ mach_msg_type_number_t thread_count, thread_info_count, j;
PyObject *py_tuple = NULL;
PyObject *py_retlist = PyList_New(0);
@@ -1146,10 +1147,10 @@ error:
static PyObject *
psutil_proc_open_files(PyObject *self, PyObject *args) {
long pid;
- int pidinfo_result;
+ unsigned long pidinfo_result;
int iterations;
int i;
- int nb;
+ unsigned long nb;
struct proc_fdinfo *fds_pointer = NULL;
struct proc_fdinfo *fdp_pointer;
@@ -1257,7 +1258,7 @@ psutil_proc_connections(PyObject *self, PyObject *args) {
int pidinfo_result;
int iterations;
int i;
- int nb;
+ unsigned long nb;
struct proc_fdinfo *fds_pointer = NULL;
struct proc_fdinfo *fdp_pointer;
diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c
index 7b650c99..9e6dc1ce 100644
--- a/psutil/arch/osx/process_info.c
+++ b/psutil/arch/osx/process_info.c
@@ -356,10 +356,10 @@ psutil_get_kinfo_proc(long pid, struct kinfo_proc *kp) {
* A wrapper around proc_pidinfo().
* Returns 0 on failure (and Python exception gets already set).
*/
-int
+unsigned long
psutil_proc_pidinfo(long pid, int flavor, uint64_t arg, void *pti, int size) {
errno = 0;
- int ret = proc_pidinfo((int)pid, flavor, arg, pti, size);
+ unsigned long ret = proc_pidinfo((int)pid, flavor, arg, pti, size);
if ((ret <= 0) || (ret < sizeof(pti))) {
psutil_raise_for_pid(pid, "proc_pidinfo() syscall failed");
return 0;
diff --git a/psutil/arch/osx/process_info.h b/psutil/arch/osx/process_info.h
index bd2eef86..83fa1231 100644
--- a/psutil/arch/osx/process_info.h
+++ b/psutil/arch/osx/process_info.h
@@ -11,7 +11,7 @@ typedef struct kinfo_proc kinfo_proc;
int psutil_get_argmax(void);
int psutil_get_kinfo_proc(long pid, struct kinfo_proc *kp);
int psutil_get_proc_list(kinfo_proc **procList, size_t *procCount);
-int psutil_proc_pidinfo(
+unsigned long psutil_proc_pidinfo(
long pid, int flavor, uint64_t arg, void *pti, int size);
PyObject* psutil_get_cmdline(long pid);
PyObject* psutil_get_environ(long pid);