Skip to content

Commit 707f945

Browse files
committed
Merge pull request #70 from rhendric/master
Return to C89 compliance
2 parents 07ea51a + 205bb05 commit 707f945

13 files changed

Lines changed: 39 additions & 8 deletions

src/MacVim/MMBackend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
137137

138138
- (void)setAntialias:(BOOL)antialias;
139139

140-
#ifdef FEAT_TRANSPARENCY
140+
#ifdef BLUR_TRANSPARENCY
141141
- (void)setBlurRadius:(int)radius;
142142
#endif
143143

src/MacVim/MMBackend.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ - (void)setAntialias:(BOOL)antialias
11801180
[self queueMessage:msgid data:nil];
11811181
}
11821182

1183-
#ifdef FEAT_TRANSPARENCY
1183+
#ifdef BLUR_TRANSPARENCY
11841184

11851185
- (void)setBlurRadius:(int)radius
11861186
{

src/MacVim/MMCoreTextView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,8 @@ - (void)batchDrawData:(NSData *)data
10761076
}
10771077
}
10781078
// fixup relative positioning
1079-
for( CFIndex i = 0; i < offset; ++i ) {
1079+
CFIndex i;
1080+
for( i = 0; i < offset; ++i ) {
10801081
positions[i].x += refPos.x;
10811082
positions[i].y += refPos.y;
10821083
}

src/MacVim/MMVimController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,10 +876,12 @@ - (void)handleMessage:(int)msgid data:(NSData *)data
876876
if (filenames)
877877
[[NSDocumentController sharedDocumentController]
878878
noteNewRecentFilePaths:filenames];
879+
#ifdef BLUR_TRANSPARENCY
879880
} else if (SetBlurRadiusMsgID == msgid) {
880881
const void *bytes = [data bytes];
881882
int radius = *((int*)bytes);
882883
[windowController setBlurRadius:radius];
884+
#endif
883885

884886
// IMPORTANT: When adding a new message, make sure to update
885887
// isUnsafeMessage() if necessary!

src/MacVim/MMWindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
- (void)setContentMinSize:(NSSize)size;
2929
- (void)setContentMaxSize:(NSSize)size;
3030
- (void)setContentSize:(NSSize)size;
31+
#ifdef BLUR_TRANSPARENCY
3132
- (void)setBlurRadius:(int)radius;
33+
#endif
3234

3335
- (IBAction)toggleFullScreen:(id)sender;
3436
- (IBAction)realToggleFullScreen:(id)sender;

src/MacVim/MMWindow.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@
2828

2929
#import "MMWindow.h"
3030
#import "Miscellaneous.h"
31-
#import "CGSInternal/CGSWindow.h"
3231

3332

33+
#ifdef BLUR_TRANSPARENCY
34+
35+
#import "CGSInternal/CGSWindow.h"
3436

3537
typedef CGError CGSSetWindowBackgroundBlurRadiusFunction(CGSConnectionID cid, CGSWindowID wid, NSUInteger blur);
3638

@@ -60,6 +62,8 @@
6062
return function;
6163
}
6264

65+
#endif // BLUR_TRANSPARENCY
66+
6367

6468

6569
@implementation MMWindow
@@ -155,6 +159,8 @@ - (void)setContentSize:(NSSize)size
155159
[super setContentSize:size];
156160
}
157161

162+
#ifdef BLUR_TRANSPARENCY
163+
158164
- (void)setBlurRadius:(int)radius
159165
{
160166
if (radius >= 0) {
@@ -169,6 +175,8 @@ - (void)setBlurRadius:(int)radius
169175
}
170176
}
171177

178+
#endif // BLUR_TRANSPARENCY
179+
172180
- (void)performClose:(id)sender
173181
{
174182
id wc = [self windowController];

src/MacVim/MMWindowController.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
NSPoint defaultTopLeft;
4747
NSToolbar *toolbar;
4848
BOOL resizingDueToMove;
49+
#ifdef BLUR_TRANSPARENCY
4950
int blurRadius;
51+
#endif
5052
}
5153

5254
- (id)initWithVimController:(MMVimController *)controller;
@@ -82,7 +84,10 @@
8284
- (void)adjustLinespace:(int)linespace;
8385
- (void)liveResizeWillStart;
8486
- (void)liveResizeDidEnd;
87+
88+
#ifdef BLUR_TRANSPARENCY
8589
- (void)setBlurRadius:(int)radius;
90+
#endif
8691

8792
- (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back;
8893
- (void)leaveFullScreen;

src/MacVim/MMWindowController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,9 @@ - (BOOL)presentWindow:(id)unused
330330
if (fullScreenEnabled && !fullScreenWindow)
331331
[decoratedWindow setAlphaValue:0];
332332

333+
#ifdef BLUR_TRANSPARENCY
333334
[decoratedWindow setBlurRadius:blurRadius];
335+
#endif
334336

335337
// Flag that the window is now placed on screen. From now on it is OK for
336338
// code to depend on the screen state. (Such as constraining views etc.)
@@ -721,13 +723,15 @@ - (void)liveResizeDidEnd
721723
}
722724
}
723725

726+
#ifdef BLUR_TRANSPARENCY
724727
- (void)setBlurRadius:(int)radius
725728
{
726729
blurRadius = radius;
727730
if (windowPresented) {
728731
[decoratedWindow setBlurRadius:radius];
729732
}
730733
}
734+
#endif
731735

732736
- (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back
733737
{

src/MacVim/gui_macvim.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,12 +2360,12 @@ static int vimModMaskToEventModifierFlags(int mods)
23602360

23612361
#endif // FEAT_BEVAL
23622362

2363-
#ifdef FEAT_TRANSPARENCY
2363+
#ifdef BLUR_TRANSPARENCY
23642364

23652365
void
23662366
gui_macvim_set_blur(int radius)
23672367
{
23682368
[[MMBackend sharedInstance] setBlurRadius:radius];
23692369
}
23702370

2371-
#endif // FEAT_TRANSPARENCY
2371+
#endif // BLUR_TRANSPARENCY

src/option.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static struct vimoption
655655
#endif
656656
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
657657
{"blurradius", "blur", P_NUM|P_VIM,
658-
#ifdef FEAT_TRANSPARENCY
658+
#ifdef BLUR_TRANSPARENCY
659659
(char_u *)&p_blur, PV_NONE,
660660
#else
661661
(char_u *)NULL, PV_NONE,
@@ -8863,7 +8863,9 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
88638863
else if (gui.in_use)
88648864
gui_mch_new_colors();
88658865
}
8866+
#endif
88668867

8868+
#ifdef BLUR_TRANSPARENCY
88678869
else if (pp == &p_blur)
88688870
{
88698871
if (p_blur < 0)

0 commit comments

Comments
 (0)