From 8b8d92a313f97d5e0e2290ec880758d8606e83c3 Mon Sep 17 00:00:00 2001 From: Mohammed Alyousef Date: Sun, 6 Apr 2025 01:05:39 +0300 Subject: Fixes error: two consecutive '[' tokens on g++ with objcpp files (#1246) Applying MoAlyousef's PR. -erco --- src/Fl_Native_File_Chooser_MAC.mm | 2 +- src/Fl_cocoa.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm index 002e0a404..77cf16585 100644 --- a/src/Fl_Native_File_Chooser_MAC.mm +++ b/src/Fl_Native_File_Chooser_MAC.mm @@ -498,7 +498,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { BOOL isdir = NO; [[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isdir]; if (isdir) return YES; - if ( fl_filename_match([filename fileSystemRepresentation], filter_pattern[ [nspopup indexOfSelectedItem] ]) ) return YES; + if ( fl_filename_match([filename fileSystemRepresentation], filter_pattern[([nspopup indexOfSelectedItem])]) ) return YES; return NO; } - (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 1e3e68637..2b8ebd7aa 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2758,7 +2758,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; NSData *data = [pboard dataForType:UTF8_pasteboard_type]; DragData = (char *)malloc([data length] + 1); [data getBytes:DragData length:[data length]]; - DragData[[data length]] = 0; + DragData[([data length])] = 0; Fl_Screen_Driver::convert_crlf(DragData, strlen(DragData)); } else { -- cgit v1.2.3