Removed deprecation and implicit cast warnings.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10729 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2015-05-04 17:00:46 +00:00
parent 626b8ef596
commit 0e633c4872

View File

@ -346,7 +346,7 @@ int Fl_Native_File_Chooser::get_saveas_basename(void) {
char *q = strdup( [[[(NSSavePanel*)_panel URL] path] UTF8String] );
if ( !(_options & SAVEAS_CONFIRM) ) {
const char *d = [[[[(NSSavePanel*)_panel URL] path] stringByDeletingLastPathComponent] UTF8String];
int l = strlen(d) + 1;
int l = (int)strlen(d) + 1;
if (strcmp(d, "/") == 0) l = 1;
int lu = strlen(UNLIKELYPREFIX);
// Remove UNLIKELYPREFIX between directory and filename parts
@ -532,7 +532,7 @@ int Fl_Native_File_Chooser::runmodal()
NSString *dir = nil;
NSString *fname = nil;
NSString *preset = nil;
int retval;
NSInteger retval;
if (_preset_file) {
preset = [[NSString alloc] initWithUTF8String:_preset_file];
if (strchr(_preset_file, '/') != NULL) {
@ -551,7 +551,7 @@ int Fl_Native_File_Chooser::runmodal()
}
[dir release];
[preset release];
return retval;
return (retval == NSFileHandlingPanelOKButton ? 1 : 0);
}
// POST BROWSER
@ -637,13 +637,13 @@ int Fl_Native_File_Chooser::post() {
}
int retval = runmodal();
if (_filt_total) {
_filt_value = [popup indexOfSelectedItem];
_filt_value = (int)[popup indexOfSelectedItem];
}
if ( retval == NSOKButton ) {
if ( retval == 1 ) {
if (is_open_panel) {
clear_pathnames();
NSArray *array = [(NSOpenPanel*)_panel URLs];
_tpathnames = [array count];
_tpathnames = (int)[array count];
_pathnames = new char*[_tpathnames];
for(int i = 0; i < _tpathnames; i++) {
_pathnames[i] = strnew([[(NSURL*)[array objectAtIndex:i] path] UTF8String]);
@ -653,7 +653,7 @@ int Fl_Native_File_Chooser::post() {
}
[key makeKeyWindow];
[localPool release];
return (retval == NSOKButton ? 0 : 1);
return (retval == 1 ? 0 : 1);
}
#endif // __APPLE__