RFR: 8240487 : Cleanup whitespace in .cc, .hh, .m, and .mm files

2020-08-05 Thread Philip Race

Bug: https://bugs.openjdk.java.net/browse/JDK-8240487
Webrev: http://cr.openjdk.java.net/~prr/8240487/

In advance of the move to Project Skara/git it is desirable to clean up 
whitespace in source files
that are not currently checked by jcheck so we can add these extensions 
to jcheck at that time.


The fix is therefore to remove tabs and trailing spaces.

The 3rd party harfbuzz library has .cc and .hh files but there are no 
current violations there

since I've cleaned those up when importing harfbuzz upgrades.

There is one JDK file that relates to those that inherited tabs that is 
fixed.


But almost all the fixes are in Objective C .m and .mm files.
JDK has no examples of .mm but JavaFX does so I was looking just to be sure.

And all but one of the .m violations are in the desktop module which is 
mainly because

that is where all but 5 of the Objective-C files are.

The only non-desktop violator is
./jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
and that is included in this webrev and why I've included 
serviceability-dev.


-phil.


Re: [OpenJDK 2D-Dev] Fwd: [PATCH] Fix compiler warnings with newer GCC 7.2.1

2018-02-03 Thread Philip Race
jpeg + harfbuzz are imported libraries. There's no point in a source fix 
in JDK'scopy as
it will get overwritten when we upgrade. No way we are tracking such 
patches to reapply them.


If warnings there are an issue either update the makefiles or use 
disable-warnings-as-errors

... and perhaps report the issue upstream ..

-phil.

On 2/3/18, 1:35 AM, Alan Bateman wrote:


This was sent to core-libs-dev, I assume it was meant for 2d-dev and 
serviceability-dev.


 Forwarded Message 
Subject:[PATCH] Fix compiler warnings with newer GCC 7.2.1
Date:   Fri, 2 Feb 2018 16:12:08 -0800
From:   Indu Bhagat 
To: core-libs-...@openjdk.java.net



This patch fixes a few of the compiler warnings when using gcc 7.2.1.

In general there are many other warnings (a majority of which are implicit 
fallthrough warnings in jdk.crypto.ec package's ecp_*.c files and java.desktop 
package's splashscreen_gfx_impl.h file).
I can post them if there is interest.
Most warnings, however, look benign (modulo some warnings about unintialized 
access that I cannot comment on; they need that the code be thoroughly 
understood).
libfdlibm misleading indentation warnings are already 
knownhttp://mail.openjdk.java.net/pipermail/jdk9-dev/2016-June/004494.html

Thanks

--
The patch fixes the following warnings :

1./jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: 
In function ‘mask_s2u’:

/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:389:22:
 warning: left shift of negative value [-Wshift-negative-value]
  *mask = htonl(-1<<  (32 - m));
   ^
2./jdk/src/java.desktop/share/native/libjavajpeg/jdphuff.c: In 
function ‘decode_mcu_AC_refine’:
/jdk/src/java.desktop/share/native/libjavajpeg/jdphuff.c:505:17: 
warning: left shift of negative value [-Wshift-negative-value]
int m1 = (-1)<<  cinfo->Al;   /* -1 in the bit position being coded*/
  ^~
3./jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:
 In function ‘void position_mark(const hb_ot_shape_plan_t*, hb_font_t*, hb_buffer_t*, 
hb_glyph_extents_t&, unsigned int, unsigned int)’:

/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:223:14:
 warning: this statement may fall through [-Wimplicit-fallthrough=]
} else if (buffer->props.direction == HB_DIRECTION_RTL) {
   ^~

/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:229:5:
 note: here
  default:
  ^~~

/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:261:27:
 warning: this statement may fall through [-Wimplicit-fallthrough=]
base_extents.height -= y_gap;
^~~~

/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:264:5:
 note: here
  case HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT:
  ^~~~

/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:282:27:
 warning: this statement may fall through [-Wimplicit-fallthrough=]
base_extents.height -= y_gap;
^~~~

/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc:285:5:
 note: here
  case HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE:
  ^~~~
---

diff --git 
a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh 
b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh
@@ -158,6 +158,9 @@
  */
  #  include
  #  define HB_FALLTHROUGH __fallthrough
+#elif __GNUC__>= 7
+   /* GNU fallthrough attribute is available from GCC7 */
+#  define HB_FALLTHROUGH __attribute__((fallthrough))
  #else
  #  define HB_FALLTHROUGH /* FALLTHROUGH */
  #endif
diff --git a/src/java.desktop/share/native/libjavajpeg/jdphuff.c 
b/src/java.desktop/share/native/libjavajpeg/jdphuff.c
--- a/src/java.desktop/share/native/libjavajpeg/jdphuff.c
+++ b/src/java.desktop/share/native/libjavajpeg/jdphuff.c
@@ -501,8 +501,10 @@
  {
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
int Se = cinfo->Se;
-  int p1 = 1<<  cinfo->Al;  /* 1 in the bit position being coded */
-  int m1 = (-1)<<  cinfo->Al;   /* -1 in the bit position being coded */
+  /* 1 in the bit position being coded */
+  int p1 = 1<<  cinfo->Al;
+  /* -1 in the bit position being coded */
+  int m1 = (int)((unsigned)(~0)<<  cinfo->Al);
register int s, k, r;
unsigned int EOBRUN;
JBLOCKROW block;
diff --git a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c 
b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
--- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
+++ b/src/jdk.jdwp.agent/

hg: jdk8/tl/jdk: 7078053: Solaris JDK build: C compiler writing tmp files into the make tree

2012-03-05 Thread philip . race
Changeset: 8b4309cbd999
Author:prr
Date:  2012-03-05 09:33 -0800
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8b4309cbd999

7078053: Solaris JDK build: C compiler writing tmp files into the make tree
Reviewed-by: ohair, alanb

! make/java/nio/Makefile
! make/sun/xawt/Makefile