Skip to content

Commit

Permalink
Merge commit '950fbab1c91f7829852c59276353652310090158' into feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ttilley committed Nov 3, 2011
2 parents ac4c61e + 950fbab commit 1fc93a4
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 96 deletions.
10 changes: 10 additions & 0 deletions ext/fsevent_watch/Info.plist
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.teaspoonofinsanity.fsevent_watch</string>
<key>CFBundleName</key>
<string>fsevent_watch</string>
</dict>
</plist>
44 changes: 41 additions & 3 deletions ext/fsevent_watch/fsevent_watch.xcodeproj/project.pbxproj
Expand Up @@ -22,6 +22,7 @@
6A57F6FF13F5E614000BE6A9 /* fsevent_watch */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fsevent_watch; sourceTree = BUILT_PRODUCTS_DIR; };
6A57F70313F5E614000BE6A9 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
6A57F70613F5E614000BE6A9 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
6A68C5E31440CBDF0040623D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
6A81FCE7143429DE00F83EDD /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
6A81FCEA14342A6300F83EDD /* TSICTString.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TSICTString.c; sourceTree = "<group>"; };
6A81FCEB14342A6300F83EDD /* TSICTString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSICTString.h; sourceTree = "<group>"; };
Expand All @@ -45,6 +46,7 @@
6A57F6F413F5E614000BE6A9 = {
isa = PBXGroup;
children = (
6A68C5E31440CBDF0040623D /* Info.plist */,
6A57F70513F5E614000BE6A9 /* fsevent_watch */,
6A57F70213F5E614000BE6A9 /* Frameworks */,
6A57F70013F5E614000BE6A9 /* Products */,
Expand Down Expand Up @@ -150,7 +152,9 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.1.0;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand All @@ -165,6 +169,7 @@
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\"",
"DEBUG=1",
"$(inherited)",
);
Expand All @@ -186,15 +191,26 @@
LD_NO_PIE = NO;
LLVM_LTO = NO;
"LLVM_LTO[arch=x86_64]" = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = NO;
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = "";
STRIP_INSTALLED_PRODUCT = NO;
VALID_ARCHS = "i386 x86_64";
WARNING_CFLAGS = "-Wall";
WARNING_CFLAGS = (
"-pedantic",
"-Wall",
"-Wextra",
"-Wpointer-arith",
"-Wformat=2",
"-Wfloat-equal",
"-Wstrict-overflow=4",
"-Wbad-function-cast",
"-Winline",
"-Wconversion",
);
};
name = Debug;
};
Expand All @@ -203,7 +219,9 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.1.0;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand All @@ -215,6 +233,10 @@
GCC_FAST_OBJC_DISPATCH = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\"",
"NDEBUG=1",
);
GCC_REUSE_STRINGS = YES;
GCC_STRICT_ALIASING = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
Expand All @@ -233,7 +255,7 @@
LD_NO_PIE = NO;
LLVM_LTO = NO;
"LLVM_LTO[arch=x86_64]" = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = NO;
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
Expand All @@ -246,15 +268,31 @@
6A57F70D13F5E614000BE6A9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
INFOPLIST_PREPROCESS = YES;
MACH_O_TYPE = mh_execute;
OTHER_LDFLAGS = (
"-sectcreate",
__TEXT,
__info_plist,
Info.plist,
);
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
6A57F70E13F5E614000BE6A9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Info.plist;
INFOPLIST_PREPROCESS = YES;
MACH_O_TYPE = mh_execute;
OTHER_LDFLAGS = (
"-sectcreate",
__TEXT,
__info_plist,
Info.plist,
);
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
24 changes: 12 additions & 12 deletions ext/fsevent_watch/fsevent_watch/TSICTString.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ext/fsevent_watch/fsevent_watch/cli.c
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion ext/fsevent_watch/fsevent_watch/cli.h
Expand Up @@ -5,8 +5,14 @@
#define CLI_NAME "fsevent_watch"
#endif /* CLI_NAME */

#ifndef PROJECT_VERSION
#error "PROJECT_VERSION not set"
#endif /* PROJECT_VERSION */

#ifndef CLI_VERSION
#define CLI_VERSION "0.0.1"
#define _str(s) #s
#define _xstr(s) _str(s)
#define CLI_VERSION _xstr(PROJECT_VERSION)
#endif /* CLI_VERSION */

#include "common.h"
Expand Down

0 comments on commit 1fc93a4

Please sign in to comment.