Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk13u-dev Public archive

Commit

Permalink
8240487: Cleanup whitespace in .cc, .hh, .m, and .mm files
Browse files Browse the repository at this point in the history
Reviewed-by: yan
Backport-of: c32923e
  • Loading branch information
Vladimir Kempik committed Apr 7, 2021
1 parent 4d5f2ab commit 98baf88
Show file tree
Hide file tree
Showing 21 changed files with 183 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (void) setBounds:(CGRect)rect {
CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
}];

JNF_COCOA_EXIT(env);

return ptr_to_jlong(surfaceLayers);
Expand All @@ -125,7 +125,7 @@ - (void) setBounds:(CGRect)rect {
JNF_COCOA_ENTER(env);

AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);

[ThreadUtilities performOnMainThreadWaiting:NO block:^(){

CGRect rect = CGRectMake(x, y, width, height);
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,11 @@ -(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint {
if ((codePoint == 0x0024) || (codePoint == 0x00A3) ||
(codePoint == 0x00A5) ||
((codePoint >= 0x20A3) && (codePoint <= 0x20BF)) ||
((codePoint >= 0x3000) && (codePoint <= 0x303F)) ||
((codePoint >= 0x3000) && (codePoint <= 0x303F)) ||
((codePoint >= 0xFF00) && (codePoint <= 0xFFEF))) {
// Code point is in 'CJK Symbols and Punctuation' or
// 'Halfwidth and Fullwidth Forms' Unicode block or
// currency symbols unicode
// currency symbols unicode
return YES;
}
return NO;
Expand Down
48 changes: 24 additions & 24 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#import "CDataTransferer.h"
#import "ThreadUtilities.h"
#import "jni_util.h"
#import "jni_util.h"
#import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>

Expand Down Expand Up @@ -79,10 +79,10 @@ - (void)declareTypes:(NSArray*)types withOwner:(jobject)owner jniEnv:(JNIEnv*)en
- (void)checkPasteboard:(id)sender {

// This is called via NSApplicationDidBecomeActiveNotification.

// If the change count on the general pasteboard is different than when we set it
// someone else put data on the clipboard. That means the current owner lost ownership.

NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];

if (self.changeCount != newChangeCount) {
Expand All @@ -109,11 +109,11 @@ - (void)checkPasteboard:(id)sender {

- (BOOL) checkPasteboardWithoutNotification:(id)application {
AWT_ASSERT_APPKIT_THREAD;

NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];

if (self.changeCount != newChangeCount) {
self.changeCount = newChangeCount;
self.changeCount = newChangeCount;
return YES;
} else {
return NO;
Expand Down Expand Up @@ -189,7 +189,7 @@ - (BOOL) checkPasteboardWithoutNotification:(id)application {
dataTypes = [[[NSPasteboard generalPasteboard] types] retain];
}];
[dataTypes autorelease];

NSUInteger nFormats = [dataTypes count];
NSUInteger knownFormats = 0;
NSUInteger i;
Expand Down Expand Up @@ -250,7 +250,7 @@ - (BOOL) checkPasteboardWithoutNotification:(id)application {
[ThreadUtilities performOnMainThreadWaiting:YES block:^() {
clipData = [[[NSPasteboard generalPasteboard] dataForType:formatAsString] retain];
}];

if (clipData == NULL) {
[JNFException raise:env as:"java/io/IOException" reason:"Font transform has NaN position"];
return NULL;
Expand All @@ -273,20 +273,20 @@ - (BOOL) checkPasteboardWithoutNotification:(id)application {
return returnValue;
}

/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboardWithoutNotification
(JNIEnv *env, jobject inObject)
{
__block BOOL ret = NO;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];
JNF_COCOA_EXIT(env);
return ret;
}
(JNIEnv *env, jobject inObject)
{
__block BOOL ret = NO;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];

JNF_COCOA_EXIT(env);
return ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ - (void)draggingExited:(id<NSDraggingInfo>)sender
JNF_MEMBER_CACHE(handleExitMessageMethod, jc_CDropTargetContextPeer, "handleExitMessage", "(Ljava/awt/Component;J)V");
if (sDraggingError == FALSE) {
DLog3(@" - dragExit: loc native %f, %f\n", sDraggingLocation.x, sDraggingLocation.y);
// AWT_THREADING Safe (CToolkitThreadBlockedHandler)
// AWT_THREADING Safe (CToolkitThreadBlockedHandler)
JNFCallVoidMethod(env, fDropTargetContextPeer,
handleExitMessageMethod, fComponent, ptr_to_jlong(self));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
if (releaseOnAppKitThread) {
// Releasing resources on the main AppKit message loop only
// Releasing resources on the nested loops may cause dangling
// Releasing resources on the nested loops may cause dangling
// pointers after the nested loop is exited
if ([NSApp respondsToSelector:@selector(postRunnableEvent:)]) {
[NSApp postRunnableEvent:^() {
Expand Down
18 changes: 9 additions & 9 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
jlong result = 0L;

JNF_COCOA_ENTER(env);

NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height);
if (imageRep) {
NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(width, height)];
Expand Down Expand Up @@ -325,16 +325,16 @@
{
if (!image) return;
NSImage *i = (NSImage *)jlong_to_ptr(image);

JNF_COCOA_ENTER(env);

NSImageRep *imageRep = nil;
NSArray *imageRepresentations = [i representations];
NSEnumerator *imageEnumerator = [imageRepresentations objectEnumerator];
while ((imageRep = [imageEnumerator nextObject]) != nil) {
[imageRep setSize:NSMakeSize(w, h)];
}

JNF_COCOA_EXIT(env);
}

Expand All @@ -356,20 +356,20 @@ NSComparisonResult getOrder(BOOL order){
NSImage *img = (NSImage *)jlong_to_ptr(image);

JNF_COCOA_ENTER(env);

NSArray *imageRepresentations = [img representations];
if([imageRepresentations count] == 0){
return NULL;
}

NSArray *sortedImageRepresentations = [imageRepresentations
sortedArrayUsingComparator: ^(id obj1, id obj2) {

NSImageRep *imageRep1 = (NSImageRep *) obj1;
NSImageRep *imageRep2 = (NSImageRep *) obj2;
NSSize size1 = [imageRep1 size];
NSSize size2 = [imageRep2 size];

if (NSEqualSizes(size1, size2)) {
return getOrder([imageRep1 pixelsWide] <= [imageRep2 pixelsWide] &&
[imageRep1 pixelsHigh] <= [imageRep2 pixelsHigh]);
Expand All @@ -380,7 +380,7 @@ NSComparisonResult getOrder(BOOL order){

NSMutableArray *sortedPixelSizes = [[[NSMutableArray alloc] init] autorelease];
NSSize lastSize = [[sortedImageRepresentations lastObject] size];

NSUInteger i = [sortedImageRepresentations indexOfObjectPassingTest:
^BOOL(id obj, NSUInteger idx, BOOL *stop) {
NSSize imageRepSize = [obj size];
Expand Down

1 comment on commit 98baf88

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.