--- main.c.orig 2006-10-30 04:56:23.000000000 -0600 +++ main.c 2013-03-31 03:17:46.000000000 -0500 @@ -69,10 +69,17 @@ static errList ERRS = { // Launch Services errors + { kLSAppInTrashErr, "application is in the Trash" }, + { kLSExecutableIncorrectFormat, "executable is unsupported on this processor architecture" }, { kLSUnknownErr, "unknown Launch Services error" }, - { kLSApplicationNotFoundErr, "application not found" }, + { kLSNotAnApplicationErr, "item is not an application" }, + { kLSDataUnavailableErr, "item metadata is unavailable" }, + { kLSApplicationNotFoundErr, "application not found for document" }, + { kLSUnknownTypeErr, "cannot determine item kind" }, { kLSLaunchInProgressErr, "application is being opened; please try again after the application is open" }, - { kLSNotRegisteredErr, "application not registered in Launch Services database" }, + { kLSServerCommunicationErr, "unable to connect to Launch Services.\nAre you logged in?" }, + { kLSIncompatibleSystemVersionErr, "application is incompatible with this version of Mac OS X" }, + { kLSNoLaunchPermissionErr, "no permission to launch this application", }, { kLSNoExecutableErr, "application package contains no executable, or an unusable executable" }, { kLSNoClassicEnvironmentErr, "Classic environment required but not available" }, { kLSMultipleSessionsNotSupportedErr, "unable to launch multiple instances of application" }, @@ -89,7 +96,6 @@ { nsvErr, "the volume cannot be found (buggy filesystem?)" }, { procNotFound, "unable to connect to system service.\nAre you logged in?" }, { kCGErrorIllegalArgument, "window server error.\nAre you logged in?" }, - { kCGErrorApplicationRequiresNewerSystem, "application requires a newer Mac OS X version" }, { fnfErr, "file not found" }, { 0, NULL } }; @@ -147,7 +153,7 @@ len = strlen(errDesc) + 10 * sizeof(char); str = (char *)malloc(len); if (str != NULL) - snprintf(str, len, "%s (%ld)", errDesc, err); + snprintf(str, len, "%s (%d)", errDesc, (int)err); else str = failedStr; return str; @@ -580,7 +586,7 @@ if (bigSize == 0) { if (littleSize == 0) { printf("zero bytes on disk (zero bytes used)\n"); return; - } else if (littleSize < 1024) printf("%lu bytes", littleSize); + } else if (littleSize < 1024) printf("%u bytes", (unsigned int)littleSize); else { UInt32 adjSize = littleSize >> 10; if (adjSize < 1024) printf("%.1f KB", DFORMAT(littleSize)); @@ -594,10 +600,10 @@ } } } else { - if (bigSize < 256) printf("%lu GB", bigSize); + if (bigSize < 256) printf("%u GB", (unsigned int)bigSize); else { bigSize >>= 2; - printf("%lu TB", bigSize); + printf("%u TB", (unsigned int)bigSize); } } printf(" on disk (%llu bytes used)\n", logicalSize); @@ -616,7 +622,7 @@ switch (fscInfo.valence) { case 0: printf("zero items\n"); break; case 1: printf("1 item\n"); break; - default: printf("%lu items\n", fscInfo.valence); + default: printf("%u items\n", (unsigned int)fscInfo.valence); } } else { printSizes("data fork size", fscInfo.dataLogicalSize, fscInfo.dataPhysicalSize, true); @@ -651,7 +657,7 @@ CFStringRef typeStr = CFStringCreateWithBytes(NULL, (UInt8 *)&osType, 4, CFStringGetSystemEncoding(), false); if (typeStr == NULL) { // punt to displaying verbatim - static char tmpBuffer[4]; + static char tmpBuffer[5]; tmpBuffer[4] = '\0'; strncpy(tmpBuffer, (const char *)&osType, 4); return tmpBuffer; @@ -735,7 +741,7 @@ printf("unknown (cputype %d, subtype %d)", fat[i].cputype, fat[i].cpusubtype); continue; } - printf(arch->description); + printf("%s", arch->description); } printf("\n"); } @@ -880,7 +886,7 @@ if (version != NULL) { printf("\tversion: %s", utf8StringFromCFStringRef(version)); - if (intVersion != 0) printf(" [0x%lx = %lu]", intVersion, intVersion); + if (intVersion != 0) printf(" [0x%x = %u]", (unsigned int)intVersion, (unsigned int)intVersion); putchar('\n'); CFRelease(version); }