Darwin arm64: Fix MacLauncher compiler warnings

GitOrigin-RevId: e5e728b584e39be59b15dc24145c1d911f00f6a8
This commit is contained in:
Florian Kistner
2020-11-17 20:59:27 +01:00
committed by intellij-monorepo-bot
parent 9bddc1bd50
commit 767c637715
13 changed files with 15 additions and 101 deletions

View File

@@ -1 +0,0 @@
MacLauncher

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CIDR_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,3 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="max" />
</component>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="OCFindUsagesOptions" text="true" ivars="false" properties="true" derivedClasses="false" />
</project>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" />
</project>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/AppLauncher.iml" filepath="$PROJECT_DIR$/.idea/AppLauncher.iml" />
</modules>
</component>
</project>

View File

@@ -1,5 +0,0 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="XcodeMetaData" PROJECT_FILE="$PROJECT_DIR$/MacLauncher.xcodeproj" />
</project>

View File

@@ -18,4 +18,13 @@
BOOL validationJavaVersion();
- (void) launch;
@end
@end
NSString *getExecutable();
NSString *jvmVersion(NSBundle *bundle);
NSString *requiredJvmVersions();
NSString *getPropertiesFilePath();
NSString *getPreferencesFolderPath();
BOOL meetMinRequirements(NSString *vmVersion);
BOOL satisfies(NSString *vmVersion, NSString *requiredVersion);
typedef jint (JNICALL *fun_ptr_t_CreateJavaVM)(JavaVM **pvm, JNIEnv **env, void *args);

View File

@@ -10,16 +10,11 @@
#import "PropertyFileReader.h"
#import "utils.h"
#import <dlfcn.h>
@class NSAlert;
typedef jint (JNICALL *fun_ptr_t_CreateJavaVM)(JavaVM **pvm, void **env, void *args);
NSBundle *vm;
NSString *const JVMOptions = @"JVMOptions";
NSString *JVMVersion = NULL;
NSString* minRequiredJavaVersion = @"1.8";
NSString* osxVersion = @"10.10";
BOOL javaUpdateRequired = false;
@interface NSString (CustomReplacements)
- (NSString *)replaceAll:(NSString *)pattern to:(NSString *)replacement;
@@ -70,14 +65,6 @@ BOOL javaUpdateRequired = false;
return self;
}
NSString* getOSXVersion(){
NSString *versionString;
NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
versionString = [sv objectForKey:@"ProductVersion"];
//NSLog(@"OS X: %@", versionString);
return versionString;
}
void showWarning(NSString* messageText){
NSAlert* alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"OK"];
@@ -85,7 +72,7 @@ void showWarning(NSString* messageText){
NSString* informativeText =[NSString stringWithFormat:@"%@",message_description];
[alert setMessageText:messageText];
[alert setInformativeText:informativeText ];
[alert setAlertStyle:NSWarningAlertStyle];
[alert setAlertStyle:NSAlertStyleWarning];
[alert runModal];
[alert release];
}
@@ -181,7 +168,7 @@ BOOL satisfies(NSString *vmVersion, NSString *requiredVersion) {
return [vmVersion hasPrefix:requiredVersion];
}
NSComparisonResult compareVMVersions(id vm1, id vm2, void *context) {
NSComparisonResult compareVMVersions(id vm1, id vm2, __unused void *context) {
return [jvmVersion(vm2) compare:jvmVersion(vm1) options:NSNumericSearch];
}
@@ -319,10 +306,6 @@ NSString *getExecutable() {
return getJVMProperty(@"idea.executable");
}
NSString *getBundleName() {
return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
}
NSString *getPropertiesFilePath() {
return [getPreferencesFolderPath() stringByAppendingString:@"/idea.properties"];
}
@@ -479,25 +462,6 @@ BOOL validationJavaVersion(){
return true;
}
- (void)alert:(NSArray *)values {
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText:[values objectAtIndex:0]];
[alert setInformativeText:[values objectAtIndex:1]];
if ([values count] > 2) {
NSTextView *accessory = [[NSTextView alloc] initWithFrame:NSMakeRect(0, 0 , 300 , 15)];
[accessory setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString: [values objectAtIndex:2]];
[str addAttribute: NSLinkAttributeName value: [values objectAtIndex:2] range: NSMakeRange(0, str.length)];
[accessory insertText:str];
[accessory setEditable:NO];
[accessory setDrawsBackground:NO];
[alert setAccessoryView:accessory];
}
[alert runModal];
}
- (void)launch {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -558,7 +522,7 @@ BOOL validationJavaVersion(){
create_vm_rc = create_vm(&jvm, &env, &args);
}
if (create_vm == NULL || create_vm_rc != JNI_OK) {
NSLog(@"JNI_CreateJavaVM (%@) failed: %ld", vm.bundlePath, create_vm_rc);
NSLog(@"JNI_CreateJavaVM (%@) failed: %d", vm.bundlePath, create_vm_rc);
exit(-1);
}
}

View File

@@ -201,7 +201,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.9;
SDKROOT = macosx;
};
name = Release;
@@ -228,7 +228,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};