@@ -238,7 +238,7 @@ private CastToIntegerFromIntNode getCastToIntNode() {
238
238
239
239
@ Specialization
240
240
@ TruffleBoundary
241
- public long doit (PIBytesLike data , PNone value ) {
241
+ public long doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone value ) {
242
242
CRC32 crc32 = new CRC32 ();
243
243
crc32 .update (getToArrayNode ().execute (data .getSequenceStorage ()));
244
244
return crc32 .getValue ();
@@ -249,15 +249,15 @@ public long doit(PIBytesLike data, long value) {
249
249
// lost magnitude is ok here.
250
250
int initValue = (int ) value ;
251
251
byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
252
- return (( long ) computeCRC32 (array , initValue ) & 0xFFFFFFFFL ) ;
252
+ return computeCRC32 (array , initValue ) & 0xFFFFFFFFL ;
253
253
}
254
254
255
255
@ Specialization
256
256
public long doPInt (PIBytesLike data , PInt value ) {
257
257
// lost magnitude is ok here.
258
258
int initValue = value .intValue ();
259
259
byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
260
- return (( long ) computeCRC32 (array , initValue ) & 0xFFFFFFFFL ) ;
260
+ return computeCRC32 (array , initValue ) & 0xFFFFFFFFL ;
261
261
}
262
262
263
263
@ Specialization
@@ -267,7 +267,7 @@ public long doObject(PIBytesLike data, Object value,
267
267
}
268
268
269
269
@ Fallback
270
- public long doObject (Object data , Object value ) {
270
+ public long doObject (Object data , @ SuppressWarnings ( "unused" ) Object value ) {
271
271
throw raise (TypeError , "a bytes-like object is required, not '%p'" , data );
272
272
}
273
273
@@ -329,7 +329,7 @@ private CastToIntegerFromIntNode getCastToIntNode() {
329
329
330
330
@ Specialization
331
331
@ TruffleBoundary
332
- public long doit (PIBytesLike data , PNone value ) {
332
+ public long doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone value ) {
333
333
Adler32 adler32 = new Adler32 ();
334
334
adler32 .update (getToArrayNode ().execute (data .getSequenceStorage ()));
335
335
return adler32 .getValue ();
@@ -340,15 +340,15 @@ public long doit(PIBytesLike data, long value) {
340
340
// lost magnitude is ok here.
341
341
int initValue = (int ) value ;
342
342
byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
343
- return (( long ) computeAdler32 (array , initValue ) & 0xFFFFFFFFL ) ;
343
+ return computeAdler32 (array , initValue ) & 0xFFFFFFFFL ;
344
344
}
345
345
346
346
@ Specialization
347
347
public long doPInt (PIBytesLike data , PInt value ) {
348
348
// lost magnitude is ok here.
349
349
int initValue = value .intValue ();
350
350
byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
351
- return (( long ) computeAdler32 (array , initValue ) & 0xFFFFFFFFL ) ;
351
+ return computeAdler32 (array , initValue ) & 0xFFFFFFFFL ;
352
352
}
353
353
354
354
@ Specialization
@@ -358,7 +358,7 @@ public long doObject(PIBytesLike data, Object value,
358
358
}
359
359
360
360
@ Fallback
361
- public long doObject (Object data , Object value ) {
361
+ public long doObject (Object data , @ SuppressWarnings ( "unused" ) Object value ) {
362
362
throw raise (TypeError , "a bytes-like object is required, not '%p'" , data );
363
363
}
364
364
@@ -399,7 +399,7 @@ private static byte[] compress(byte[] input, int level) {
399
399
}
400
400
401
401
@ Specialization
402
- public PBytes doit (PIBytesLike data , PNone level ) {
402
+ public PBytes doit (PIBytesLike data , @ SuppressWarnings ( "unused" ) PNone level ) {
403
403
byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
404
404
return factory ().createBytes (compress (array , -1 ));
405
405
}
@@ -470,7 +470,7 @@ private byte[] decompress(byte[] input, @SuppressWarnings("unused") int wbits, i
470
470
471
471
@ Specialization
472
472
@ 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 ) {
474
474
byte [] array = getToArrayNode ().execute (data .getSequenceStorage ());
475
475
return factory ().createBytes (decompress (array , MAX_WBITS , DEF_BUF_SIZE ));
476
476
}
@@ -485,11 +485,9 @@ public PBytes decompress(PIBytesLike data, long wbits, int bufsize) {
485
485
// checking bufsize
486
486
if (bufSizeProfile .profile (bufsize < 0 )) {
487
487
throw raise (ZLibError , "bufsize must be non-negative" );
488
- } else if (bufsize == 0 ) {
489
- bufsize = 1 ;
490
488
}
491
489
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 ));
493
491
}
494
492
495
493
@ Specialization
0 commit comments