[22765] users/rhwood/Pallet
source_changes at macosforge.org
source_changes at macosforge.org
Tue Mar 13 16:26:18 PDT 2007
Revision: 22765
http://trac.macosforge.org/projects/macports/changeset/22765
Author: eridius at macports.org
Date: 2007-03-13 16:26:18 -0700 (Tue, 13 Mar 2007)
Log Message:
-----------
Silence warnings
Modified Paths:
--------------
users/rhwood/Pallet/Launcher.c
users/rhwood/Pallet/PortAuthority.m
users/rhwood/Pallet/getpath.c
Modified: users/rhwood/Pallet/Launcher.c
===================================================================
--- users/rhwood/Pallet/Launcher.c 2007-03-13 23:26:06 UTC (rev 22764)
+++ users/rhwood/Pallet/Launcher.c 2007-03-13 23:26:18 UTC (rev 22765)
@@ -220,8 +220,10 @@
int chownerr = 0;
int chmoderr;
char* path_to_self = getPathToMyself();
+#ifndef DEBUGGING
char path_to_res[BUFSIZE];
char* end_of_dir;
+#endif
/* Don't change ownership of Resource directory during development;
it causes clean build to fail. */
Modified: users/rhwood/Pallet/PortAuthority.m
===================================================================
--- users/rhwood/Pallet/PortAuthority.m 2007-03-13 23:26:06 UTC (rev 22764)
+++ users/rhwood/Pallet/PortAuthority.m 2007-03-13 23:26:18 UTC (rev 22765)
@@ -243,7 +243,6 @@
- (void)defaultAction:(id)items
{
id item;
- NSEnumerator *itemsEnumerator;
switch ([[item valueForKey:@"status"] intValue]) {
case portStatusActive:
[self launchAuthorizedExecutableWithArguments:[NSArray arrayWithObjects:macPortsPort,
Modified: users/rhwood/Pallet/getpath.c
===================================================================
--- users/rhwood/Pallet/getpath.c 2007-03-13 23:26:06 UTC (rev 22764)
+++ users/rhwood/Pallet/getpath.c 2007-03-13 23:26:18 UTC (rev 22765)
@@ -47,6 +47,7 @@
12/19/01 2.0d1 First release of self-repair version.
*/
+/* Modified 3/13/07 by Kevin Ballard to avoid using deprecated functions */
#include <stdio.h>
#include <string.h>
@@ -56,6 +57,7 @@
#include <crt_externs.h>
#include <errno.h>
#include <mach-o/dyld.h>
+#include <dlfcn.h>
typedef int (*NSGetExecutablePathProcPtr)(char *buf, size_t *bufsize);
@@ -141,15 +143,11 @@
int
MyGetExecutablePath(char *execPath, size_t *execPathSize)
{
- if (NSIsSymbolNameDefined("__NSGetExecutablePath"))
- {
- return ((NSGetExecutablePathProcPtr) NSAddressOfSymbol(NSLookupAndBindSymbol("__NSGetExecutablePath")))(execPath, execPathSize);
- }
- else
- {
- // The function _NSGetExecutablePath() is new in Jaguar, so use this custom version when running on 10.1.x and earlier.
- return NSGetExecutablePathOnTenOneAndEarlierOnly(execPath, execPathSize);
- }
+ NSGetExecutablePathProcPtr funcPtr = NULL;
+ if ((funcPtr = (NSGetExecutablePathProcPtr)dlsym(RTLD_DEFAULT, "_NSGetExecutablePath")) == NULL) {
+ funcPtr = (NSGetExecutablePathProcPtr)NSGetExecutablePathOnTenOneAndEarlierOnly;
+ }
+ return funcPtr(execPath, execPathSize);
}
char* getPathToMyself()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070313/8cc360d4/attachment.html
More information about the macports-changes
mailing list