@@ -238,7 +238,7 @@ private CastToIntegerFromIntNode getCastToIntNode() {
238238
239239 @ Specialization
240240 @ TruffleBoundary
241- public long doit (PIBytesLike data , PNone value ) {
241+ public long doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone value ) {
242242 CRC32 crc32 = new CRC32 ();
243243 crc32 .update (getToArrayNode ().execute (data .getSequenceStorage ()));
244244 return crc32 .getValue ();
@@ -249,15 +249,15 @@ public long doit(PIBytesLike data, long value) {
249249 // lost magnitude is ok here.
250250 int initValue = (int ) value ;
251251 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
252- return (( long ) computeCRC32 (array , initValue ) & 0xFFFFFFFFL ) ;
252+ return computeCRC32 (array , initValue ) & 0xFFFFFFFFL ;
253253 }
254254
255255 @ Specialization
256256 public long doPInt (PIBytesLike data , PInt value ) {
257257 // lost magnitude is ok here.
258258 int initValue = value .intValue ();
259259 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
260- return (( long ) computeCRC32 (array , initValue ) & 0xFFFFFFFFL ) ;
260+ return computeCRC32 (array , initValue ) & 0xFFFFFFFFL ;
261261 }
262262
263263 @ Specialization
@@ -267,7 +267,7 @@ public long doObject(PIBytesLike data, Object value,
267267 }
268268
269269 @ Fallback
270- public long doObject (Object data , Object value ) {
270+ public long doObject (Object data , @ SuppressWarnings ( "unused" ) Object value ) {
271271 throw raise (TypeError , "a bytes-like object is required, not '%p'" , data );
272272 }
273273
@@ -329,7 +329,7 @@ private CastToIntegerFromIntNode getCastToIntNode() {
329329
330330 @ Specialization
331331 @ TruffleBoundary
332- public long doit (PIBytesLike data , PNone value ) {
332+ public long doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone value ) {
333333 Adler32 adler32 = new Adler32 ();
334334 adler32 .update (getToArrayNode ().execute (data .getSequenceStorage ()));
335335 return adler32 .getValue ();
@@ -340,15 +340,15 @@ public long doit(PIBytesLike data, long value) {
340340 // lost magnitude is ok here.
341341 int initValue = (int ) value ;
342342 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
343- return (( long ) computeAdler32 (array , initValue ) & 0xFFFFFFFFL ) ;
343+ return computeAdler32 (array , initValue ) & 0xFFFFFFFFL ;
344344 }
345345
346346 @ Specialization
347347 public long doPInt (PIBytesLike data , PInt value ) {
348348 // lost magnitude is ok here.
349349 int initValue = value .intValue ();
350350 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
351- return (( long ) computeAdler32 (array , initValue ) & 0xFFFFFFFFL ) ;
351+ return computeAdler32 (array , initValue ) & 0xFFFFFFFFL ;
352352 }
353353
354354 @ Specialization
@@ -358,7 +358,7 @@ public long doObject(PIBytesLike data, Object value,
358358 }
359359
360360 @ Fallback
361- public long doObject (Object data , Object value ) {
361+ public long doObject (Object data , @ SuppressWarnings ( "unused" ) Object value ) {
362362 throw raise (TypeError , "a bytes-like object is required, not '%p'" , data );
363363 }
364364
@@ -399,7 +399,7 @@ private static byte[] compress(byte[] input, int level) {
399399 }
400400
401401 @ Specialization
402- public PBytes doit (PIBytesLike data , PNone level ) {
402+ public PBytes doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone level ) {
403403 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
404404 return factory ().createBytes (compress (array , -1 ));
405405 }
@@ -470,7 +470,7 @@ private byte[] decompress(byte[] input, @SuppressWarnings("unused") int wbits, i
470470
471471 @ Specialization
472472 @ TruffleBoundary
473- public PBytes doit (PIBytesLike data , PNone wbits , PNone bufsize ) {
473+ public PBytes doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone wbits , @ SuppressWarnings ( "unused" ) PNone bufsize ) {
474474 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
475475 return factory ().createBytes (decompress (array , MAX_WBITS , DEF_BUF_SIZE ));
476476 }
@@ -485,11 +485,9 @@ public PBytes decompress(PIBytesLike data, long wbits, int bufsize) {
485485 // checking bufsize
486486 if (bufSizeProfile .profile (bufsize < 0 )) {
487487 throw raise (ZLibError , "bufsize must be non-negative" );
488- } else if (bufsize == 0 ) {
489- bufsize = 1 ;
490488 }
491489 byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
492- return factory ().createBytes (decompress (array , (int ) wbits , bufsize ));
490+ return factory ().createBytes (decompress (array , (int ) wbits , bufsize == 0 ? 1 : bufsize ));
493491 }
494492
495493 @ Specialization
0 commit comments