From 307ddd5885afa921239d2908c8f497c7d0566fd8 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 11 Jun 2014 13:15:51 +0400 Subject: [PATCH] Cleanup (correct types; imports) --- bin/mac/fsnotifier | Bin 13984 -> 13984 bytes native/fsNotifier/mac/fsnotifier.c | 12 +++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/mac/fsnotifier b/bin/mac/fsnotifier index 2e7cc30d86968aed5caebca2f515dc2a79540805..9bbf3898bb5dff531c425325803098472bba23d8 100755 GIT binary patch delta 36 ucmV+<0NekdZJ=$i`~(n>E^Zt&Dm&M*5S*Ii)K{Cc3xTvoKAYUnTPeLFk{c=OA_Z~0X&Hi$p8QV diff --git a/native/fsNotifier/mac/fsnotifier.c b/native/fsNotifier/mac/fsnotifier.c index 907456a22453..45c383a9fcce 100644 --- a/native/fsNotifier/mac/fsnotifier.c +++ b/native/fsNotifier/mac/fsnotifier.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ #include #include +#include +#include #include #define PRIVATE_DIR "/private/" @@ -25,7 +27,7 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static bool report_private = true; static void reportEvent(char *event, char *path) { - int len = 0; + size_t len = 0; if (path != NULL) { len = strlen(path); for (char* p = path; *p != '\0'; p++) { @@ -84,7 +86,7 @@ static void PrintMountedFileSystems(CFArrayRef roots) { if (fsCount == -1) return; struct statfs fs[fsCount]; - fsCount = getfsstat(fs, sizeof(struct statfs) * fsCount, MNT_NOWAIT); + fsCount = getfsstat(fs, (int)(sizeof(struct statfs) * fsCount), MNT_NOWAIT); if (fsCount == -1) return; CFMutableArrayRef mounts = CFArrayCreateMutable(NULL, 0, NULL); @@ -92,11 +94,11 @@ static void PrintMountedFileSystems(CFArrayRef roots) { for (int i = 0; i < fsCount; i++) { if ((fs[i].f_flags & MNT_LOCAL) != MNT_LOCAL) { char *mount = fs[i].f_mntonname; - int mountLen = strlen(mount); + size_t mountLen = strlen(mount); for (int j = 0; j < CFArrayGetCount(roots); j++) { char *root = (char *)CFArrayGetValueAtIndex(roots, j); - int rootLen = strlen(root); + size_t rootLen = strlen(root); if (rootLen >= mountLen && strncmp(root, mount, mountLen) == 0) { // root under mount point