Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bump up warning level, fix warnings

  • Loading branch information...
commit 950fbab1c91f7829852c59276353652310090158 1 parent f7d0564
@ttilley authored
View
8 fsevent_watch.xcodeproj/project.pbxproj
@@ -200,8 +200,16 @@
STRIP_INSTALLED_PRODUCT = NO;
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = (
+ "-pedantic",
"-Wall",
"-Wextra",
+ "-Wpointer-arith",
+ "-Wformat=2",
+ "-Wfloat-equal",
+ "-Wstrict-overflow=4",
+ "-Wbad-function-cast",
+ "-Winline",
+ "-Wconversion",
);
};
name = Debug;
View
24 fsevent_watch/TSICTString.c
@@ -16,13 +16,13 @@ TSITStringFormat TSITStringDefaultFormat = kTSITStringFormatTNetstring;
static const CFRange BeginningRange = {0,0};
-static CFTypeID kCFDataTypeID = -1;
-static CFTypeID kCFStringTypeID = -1;
-static CFTypeID kCFNumberTypeID = -1;
-static CFTypeID kCFBooleanTypeID = -1;
-static CFTypeID kCFNullTypeID = -1;
-static CFTypeID kCFArrayTypeID = -1;
-static CFTypeID kCFDictionaryTypeID = -1;
+static CFTypeID kCFDataTypeID = -1UL;
+static CFTypeID kCFStringTypeID = -1UL;
+static CFTypeID kCFNumberTypeID = -1UL;
+static CFTypeID kCFBooleanTypeID = -1UL;
+static CFTypeID kCFNullTypeID = -1UL;
+static CFTypeID kCFArrayTypeID = -1UL;
+static CFTypeID kCFDictionaryTypeID = -1UL;
__attribute__((constructor)) void Init_TSICTString(void)
@@ -88,14 +88,14 @@ static inline CFDataRef TSICTStringCreateDataFromIntermediateRepresentation(TStr
UInt8* bufferBytes = CFDataGetMutableBytePtr(buffer);
size_t prefixLength = strlen(rep->length) + 1;
- CFDataReplaceBytes(buffer, BeginningRange, (const UInt8*)rep->length, prefixLength);
+ CFDataReplaceBytes(buffer, BeginningRange, (const UInt8*)rep->length, (CFIndex)prefixLength);
if (rep->format == kTSITStringFormatTNetstring) {
- const UInt8 ftag = TNetstringTypes[rep->type];
+ const UInt8 ftag = (UInt8)TNetstringTypes[rep->type];
CFDataAppendBytes(buffer, &ftag, 1);
bufferBytes[(prefixLength - 1)] = TNetstringSeparator;
} else if (rep->format == kTSITStringFormatOTNetstring) {
- const UInt8 ftag = OTNetstringTypes[rep->type];
+ const UInt8 ftag = (UInt8)OTNetstringTypes[rep->type];
bufferBytes[(prefixLength - 1)] = ftag;
}
@@ -315,13 +315,13 @@ TStringIRep* TSICTStringCreateWithNumberAndFormat(CFNumberRef number, TSITString
}
memmove(p, e, strlen(e)+1);
- data = CFDataCreate(kCFAllocatorDefault, (UInt8*)buf, strlen(buf));
+ data = CFDataCreate(kCFAllocatorDefault, (UInt8*)buf, (CFIndex)strlen(buf));
} else {
char buf[32];
SInt64 value;
CFNumberGetValue(number, numType, &value);
sprintf(buf, "%lli", value);
- data = CFDataCreate(kCFAllocatorDefault, (UInt8*)buf, strlen(buf));
+ data = CFDataCreate(kCFAllocatorDefault, (UInt8*)buf, (CFIndex)strlen(buf));
}
TStringIRep* rep = TSICTStringCreateWithDataOfTypeAndFormat(data, tag, format);
View
2  fsevent_watch/cli.c
@@ -146,7 +146,7 @@ int cli_parser (int argc, const char** argv, struct cli_info* args_info)
if (optind < argc) {
int i = 0;
- args_info->inputs_num = argc - optind;
+ args_info->inputs_num = (unsigned int)(argc - optind);
args_info->inputs =
(char**)(malloc ((args_info->inputs_num)*sizeof(char*)));
while (optind < argc)
View
4 fsevent_watch/main.c
@@ -52,7 +52,7 @@ static void append_path(const char* path)
fprintf(stderr, "compiled against 10.6+, using CFURLCreateFileReferenceURL\n");
#endif
- CFURLRef url = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8*)path, strlen(path), false);
+ CFURLRef url = CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8*)path, (CFIndex)strlen(path), false);
CFURLRef placeholder = CFURLCopyAbsoluteURL(url);
CFRelease(url);
@@ -325,7 +325,7 @@ static void tstring_output_format(size_t numEvents,
CFStringRef path = CFStringCreateWithBytes(kCFAllocatorDefault,
(const UInt8*)paths[i],
- strlen(paths[i]),
+ (CFIndex)strlen(paths[i]),
kCFStringEncodingUTF8,
false);
CFDictionarySetValue(event, CFSTR("path"), path);
Please sign in to comment.
Something went wrong with that request. Please try again.