diff options
Diffstat (limited to 'usr/src')
20 files changed, 201 insertions, 211 deletions
diff --git a/usr/src/boot/sys/boot/Makefile.inc b/usr/src/boot/sys/boot/Makefile.inc index 96cc368155..67a64acc6c 100644 --- a/usr/src/boot/sys/boot/Makefile.inc +++ b/usr/src/boot/sys/boot/Makefile.inc @@ -52,7 +52,7 @@ CFLAGS += $(CCNOAUTOINLINE) $(CCNOREORDER) $(CSTD_GNU99) CCASFLAGS= -fPIC -Wa,--divide ASFLAGS= --divide -COMPILE.S= $(CC) $(CCASFLAGS) $(CPPFLAGS) -c +COMPILE.S= $(CC) $(SMATCH_off) $(CCASFLAGS) $(CPPFLAGS) -c ROOT_BOOT= $(ROOT)/boot ROOTBOOTPROG=$(PROG:%=$(ROOT_BOOT)/%) diff --git a/usr/src/boot/sys/boot/i386/pxeldr/Makefile b/usr/src/boot/sys/boot/i386/pxeldr/Makefile index 64701d15b5..15661bdf23 100644 --- a/usr/src/boot/sys/boot/i386/pxeldr/Makefile +++ b/usr/src/boot/sys/boot/i386/pxeldr/Makefile @@ -19,7 +19,10 @@ include $(SRC)/boot/sys/boot/Makefile.inc ROOT_BOOT = $(ROOT)/boot DD= /usr/bin/dd -CFLAGS += -I../../.. + +CPPFLAGS += -I../../.. +CPPFLAGS += -I../common + CCASFLAGS= -Wa,--divide include ../Makefile.inc @@ -46,8 +49,6 @@ FILEMODE=0444 #CFLAGS+=-DALWAYS_SERIAL #.endif -CFLAGS += -I../common - LOADERBIN= ../loader/loader.bin CLEANFILES += ${BOOT}.tmp @@ -76,8 +77,5 @@ clobber: clean clean: $(RM) $(CLEANFILES) -.S.o: - $(CC) $(CFLAGS) $(CCASFLAGS) -c -o $@ $< - $(ROOT_BOOT)/%: % $(INS.file) diff --git a/usr/src/common/bzip2/bzlib.c b/usr/src/common/bzip2/bzlib.c index de5c009de8..06b37767c9 100644 --- a/usr/src/common/bzip2/bzlib.c +++ b/usr/src/common/bzip2/bzlib.c @@ -11,7 +11,7 @@ bzip2/libbzip2 version 1.0.6 of 6 September 2010 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org> - Please read the WARNING, DISCLAIMER and PATENTS sections in the + Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. This program is released under the terms of the license contained @@ -41,7 +41,7 @@ #ifndef BZ_NO_STDIO void BZ2_bz__AssertH__fail ( int errcode ) { - fprintf(stderr, + fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" "Please report it to me at: jseward@bzip.org. If this happened\n" @@ -115,9 +115,9 @@ BZE(BZ_DATA_ERROR_MAGIC) \ BZE(BZ_IO_ERROR) \ BZE(BZ_UNEXPECTED_EOF) \ BZE(BZ_OUTBUFF_FULL) \ -BZE(BZ_CONFIG_ERROR) +BZE(BZ_CONFIG_ERROR) -BZ_EXTERN const char * BZ_API(BZ2_bzErrorString) ( +const char * BZ_API(BZ2_bzErrorString) ( int error_code ) { @@ -228,8 +228,8 @@ Bool isempty_RL ( EState* s ) /*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompressInit) - ( bz_stream* strm, +int BZ_API(BZ2_bzCompressInit) + ( bz_stream* strm, int blockSize100k, int verbosity, int workFactor ) @@ -239,7 +239,7 @@ int BZ_API(BZ2_bzCompressInit) if (!bz_config_ok()) return BZ_CONFIG_ERROR; - if (strm == NULL || + if (strm == NULL || blockSize100k < 1 || blockSize100k > 9 || workFactor < 0 || workFactor > 250) return BZ_PARAM_ERROR; @@ -297,7 +297,7 @@ int BZ_API(BZ2_bzCompressInit) /* * returns the BZALLOC size needed for bzCompressInit */ -int BZ_API(BZ2_bzCompressInitSize) ( +int BZ_API(BZ2_bzCompressInitSize) ( int blockSize100k) { Int32 n, t; @@ -438,7 +438,7 @@ Bool copy_input_until_stop ( EState* s ) /*-- no input? --*/ if (s->strm->avail_in == 0) break; progress_in = True; - ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); + ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); s->strm->next_in++; s->strm->avail_in--; s->strm->total_in_lo32++; @@ -456,7 +456,7 @@ Bool copy_input_until_stop ( EState* s ) /*-- flush/finish end? --*/ if (s->avail_in_expect == 0) break; progress_in = True; - ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); + ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); s->strm->next_in++; s->strm->avail_in--; s->strm->total_in_lo32++; @@ -502,18 +502,18 @@ Bool handle_compress ( bz_stream* strm ) Bool progress_in = False; Bool progress_out = False; EState* s = strm->state; - + while (True) { if (s->state == BZ_S_OUTPUT) { progress_out |= copy_output_until_stop ( s ); if (s->state_out_pos < s->numZ) break; - if (s->mode == BZ_M_FINISHING && + if (s->mode == BZ_M_FINISHING && s->avail_in_expect == 0 && isempty_RL(s)) break; prepare_new_block ( s ); s->state = BZ_S_INPUT; - if (s->mode == BZ_M_FLUSHING && + if (s->mode == BZ_M_FLUSHING && s->avail_in_expect == 0 && isempty_RL(s)) break; } @@ -562,7 +562,7 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) if (action == BZ_RUN) { progress = handle_compress ( strm ); return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; - } + } else if (action == BZ_FLUSH) { s->avail_in_expect = strm->avail_in; @@ -575,12 +575,12 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) s->mode = BZ_M_FINISHING; goto preswitch; } - else + else return BZ_PARAM_ERROR; case BZ_M_FLUSHING: if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect != s->strm->avail_in) + if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); if (s->avail_in_expect > 0 || !isempty_RL(s) || @@ -590,7 +590,7 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) case BZ_M_FINISHING: if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect != s->strm->avail_in) + if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); if (!progress) return BZ_SEQUENCE_ERROR; @@ -617,7 +617,7 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) if (s->ftab != NULL) BZFREE(s->ftab); BZFREE(strm->state); - strm->state = NULL; + strm->state = NULL; return BZ_OK; } @@ -629,8 +629,8 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) /*---------------------------------------------------*/ /*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompressInit) - ( bz_stream* strm, +int BZ_API(BZ2_bzDecompressInit) + ( bz_stream* strm, int verbosity, int small ) { @@ -728,34 +728,34 @@ Bool unRLE_obuf_to_output_FAST ( DState* s ) /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; - + /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; - + s->state_out_len = 1; s->state_out_ch = s->k0; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - + s->state_out_len = 2; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - + s->state_out_len = 3; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; - BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; + BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; s->nblock_used++; } @@ -793,7 +793,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s ) } s_state_out_len_eq_one: { - if (cs_avail_out == 0) { + if (cs_avail_out == 0) { c_state_out_len = 1; goto return_notr; }; *( (UChar*)(cs_next_out) ) = c_state_out_ch; @@ -801,7 +801,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s ) cs_next_out++; cs_avail_out--; } - } + } /* Only caused by corrupt data stream? */ if (c_nblock_used > s_save_nblockPP) return True; @@ -809,26 +809,30 @@ Bool unRLE_obuf_to_output_FAST ( DState* s ) /* can a new run be started? */ if (c_nblock_used == s_save_nblockPP) { c_state_out_len = 0; goto return_notr; - }; + }; c_state_out_ch = c_k0; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (k1 != c_k0) { - c_k0 = k1; goto s_state_out_len_eq_one; + BZ_GET_FAST_C(k1); + c_nblock_used++; + if (k1 != c_k0) { + c_k0 = k1; goto s_state_out_len_eq_one; }; - if (c_nblock_used == s_save_nblockPP) + if (c_nblock_used == s_save_nblockPP) goto s_state_out_len_eq_one; - + c_state_out_len = 2; - BZ_GET_FAST_C(k1); c_nblock_used++; + BZ_GET_FAST_C(k1); + c_nblock_used++; if (c_nblock_used == s_save_nblockPP) continue; if (k1 != c_k0) { c_k0 = k1; continue; }; - + c_state_out_len = 3; - BZ_GET_FAST_C(k1); c_nblock_used++; + BZ_GET_FAST_C(k1); + c_nblock_used++; if (c_nblock_used == s_save_nblockPP) continue; if (k1 != c_k0) { c_k0 = k1; continue; }; - - BZ_GET_FAST_C(k1); c_nblock_used++; + + BZ_GET_FAST_C(k1); + c_nblock_used++; c_state_out_len = ((Int32)k1) + 4; BZ_GET_FAST_C(c_k0); c_nblock_used++; } @@ -895,37 +899,37 @@ Bool unRLE_obuf_to_output_SMALL ( DState* s ) s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } - + /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; - + s->state_out_len = 1; s->state_out_ch = s->k0; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - + s->state_out_len = 2; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - + s->state_out_len = 3; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; - BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; + BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; s->nblock_used++; } @@ -944,31 +948,35 @@ Bool unRLE_obuf_to_output_SMALL ( DState* s ) s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } - + /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; - + s->state_out_len = 1; s->state_out_ch = s->k0; - BZ_GET_SMALL(k1); s->nblock_used++; + BZ_GET_SMALL(k1); + s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - + s->state_out_len = 2; - BZ_GET_SMALL(k1); s->nblock_used++; + BZ_GET_SMALL(k1); + s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - + s->state_out_len = 3; - BZ_GET_SMALL(k1); s->nblock_used++; + BZ_GET_SMALL(k1); + s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_SMALL(k1); s->nblock_used++; + + BZ_GET_SMALL(k1); + s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_SMALL(s->k0); s->nblock_used++; } @@ -996,14 +1004,14 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) if (corrupt) return BZ_DATA_ERROR; if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { BZ_FINALISE_CRC ( s->calculatedBlockCRC ); - if (s->verbosity >= 3) - VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, + if (s->verbosity >= 3) + VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, s->calculatedBlockCRC ); if (s->verbosity >= 2) VPrintf0 ( "]" ); if (s->calculatedBlockCRC != s->storedBlockCRC) return BZ_DATA_ERROR; - s->calculatedCombinedCRC - = (s->calculatedCombinedCRC << 1) | + s->calculatedCombinedCRC + = (s->calculatedCombinedCRC << 1) | (s->calculatedCombinedCRC >> 31); s->calculatedCombinedCRC ^= s->calculatedBlockCRC; s->state = BZ_X_BLKHDR_1; @@ -1015,7 +1023,7 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) Int32 r = BZ2_decompress ( s ); if (r == BZ_STREAM_END) { if (s->verbosity >= 3) - VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", + VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", s->storedCombinedCRC, s->calculatedCombinedCRC ); if (s->calculatedCombinedCRC != s->storedCombinedCRC) return BZ_DATA_ERROR; @@ -1065,7 +1073,7 @@ int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) if (bzf != NULL) bzf->lastErr = eee; \ } -typedef +typedef struct { FILE* handle; Char buf[BZ_MAX_UNUSED]; @@ -1089,10 +1097,10 @@ static Bool myfeof ( FILE* f ) /*---------------------------------------------------*/ -BZFILE* BZ_API(BZ2_bzWriteOpen) - ( int* bzerror, - FILE* f, - int blockSize100k, +BZFILE* BZ_API(BZ2_bzWriteOpen) + ( int* bzerror, + FILE* f, + int blockSize100k, int verbosity, int workFactor ) { @@ -1124,23 +1132,23 @@ BZFILE* BZ_API(BZ2_bzWriteOpen) bzf->strm.opaque = NULL; if (workFactor == 0) workFactor = 30; - ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, + ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, verbosity, workFactor ); if (ret != BZ_OK) { BZ_SETERR(ret); free(bzf); return NULL; }; bzf->strm.avail_in = 0; bzf->initialisedOk = True; - return bzf; + return bzf; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzWrite) - ( int* bzerror, - BZFILE* b, - void* buf, + ( int* bzerror, + BZFILE* b, + void* buf, int len ) { Int32 n, n2, ret; @@ -1169,7 +1177,7 @@ void BZ_API(BZ2_bzWrite) if (bzf->strm.avail_out < BZ_MAX_UNUSED) { n = BZ_MAX_UNUSED - bzf->strm.avail_out; - n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), + n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), n, bzf->handle ); if (n != n2 || ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; @@ -1183,20 +1191,20 @@ void BZ_API(BZ2_bzWrite) /*---------------------------------------------------*/ void BZ_API(BZ2_bzWriteClose) - ( int* bzerror, - BZFILE* b, + ( int* bzerror, + BZFILE* b, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out ) { - BZ2_bzWriteClose64 ( bzerror, b, abandon, + BZ2_bzWriteClose64 ( bzerror, b, abandon, nbytes_in, NULL, nbytes_out, NULL ); } void BZ_API(BZ2_bzWriteClose64) - ( int* bzerror, - BZFILE* b, + ( int* bzerror, + BZFILE* b, int abandon, unsigned int* nbytes_in_lo32, unsigned int* nbytes_in_hi32, @@ -1228,7 +1236,7 @@ void BZ_API(BZ2_bzWriteClose64) if (bzf->strm.avail_out < BZ_MAX_UNUSED) { n = BZ_MAX_UNUSED - bzf->strm.avail_out; - n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), + n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), n, bzf->handle ); if (n != n2 || ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; @@ -1260,9 +1268,9 @@ void BZ_API(BZ2_bzWriteClose64) /*---------------------------------------------------*/ -BZFILE* BZ_API(BZ2_bzReadOpen) - ( int* bzerror, - FILE* f, +BZFILE* BZ_API(BZ2_bzReadOpen) + ( int* bzerror, + FILE* f, int verbosity, int small, void* unused, @@ -1273,7 +1281,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen) BZ_SETERR(BZ_OK); - if (f == NULL || + if (f == NULL || (small != 0 && small != 1) || (verbosity < 0 || verbosity > 4) || (unused == NULL && nUnused != 0) || @@ -1284,7 +1292,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; bzf = malloc ( sizeof(bzFile) ); - if (bzf == NULL) + if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; BZ_SETERR(BZ_OK); @@ -1296,7 +1304,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen) bzf->strm.bzalloc = NULL; bzf->strm.bzfree = NULL; bzf->strm.opaque = NULL; - + while (nUnused > 0) { bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; unused = ((void*)( 1 + ((UChar*)(unused)) )); @@ -1311,7 +1319,7 @@ BZFILE* BZ_API(BZ2_bzReadOpen) bzf->strm.next_in = bzf->buf; bzf->initialisedOk = True; - return bzf; + return bzf; } @@ -1334,10 +1342,10 @@ void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) /*---------------------------------------------------*/ -int BZ_API(BZ2_bzRead) - ( int* bzerror, - BZFILE* b, - void* buf, +int BZ_API(BZ2_bzRead) + ( int* bzerror, + BZFILE* b, + void* buf, int len ) { Int32 n, ret; @@ -1359,11 +1367,11 @@ int BZ_API(BZ2_bzRead) while (True) { - if (ferror(bzf->handle)) + if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return 0; }; if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { - n = fread ( bzf->buf, sizeof(UChar), + n = fread ( bzf->buf, sizeof(UChar), BZ_MAX_UNUSED, bzf->handle ); if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return 0; }; @@ -1377,7 +1385,7 @@ int BZ_API(BZ2_bzRead) if (ret != BZ_OK && ret != BZ_STREAM_END) { BZ_SETERR(ret); return 0; }; - if (ret == BZ_OK && myfeof(bzf->handle) && + if (ret == BZ_OK && myfeof(bzf->handle) && bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; @@ -1386,7 +1394,7 @@ int BZ_API(BZ2_bzRead) return len - bzf->strm.avail_out; }; if (bzf->strm.avail_out == 0) { BZ_SETERR(BZ_OK); return len; }; - + } return 0; /*not reached*/ @@ -1394,10 +1402,10 @@ int BZ_API(BZ2_bzRead) /*---------------------------------------------------*/ -void BZ_API(BZ2_bzReadGetUnused) - ( int* bzerror, - BZFILE* b, - void** unused, +void BZ_API(BZ2_bzReadGetUnused) + ( int* bzerror, + BZFILE* b, + void** unused, int* nUnused ) { bzFile* bzf = (bzFile*)b; @@ -1420,30 +1428,30 @@ void BZ_API(BZ2_bzReadGetUnused) /*---------------------------------------------------*/ /*---------------------------------------------------*/ -int BZ_API(BZ2_bzBuffToBuffCompress) - ( char* dest, +int BZ_API(BZ2_bzBuffToBuffCompress) + ( char* dest, unsigned int* destLen, - char* source, + char* source, unsigned int sourceLen, - int blockSize100k, - int verbosity, + int blockSize100k, + int verbosity, int workFactor ) { bz_stream strm; int ret; - if (dest == NULL || destLen == NULL || + if (dest == NULL || destLen == NULL || source == NULL || blockSize100k < 1 || blockSize100k > 9 || verbosity < 0 || verbosity > 4 || - workFactor < 0 || workFactor > 250) + workFactor < 0 || workFactor > 250) return BZ_PARAM_ERROR; if (workFactor == 0) workFactor = 30; strm.bzalloc = NULL; strm.bzfree = NULL; strm.opaque = NULL; - ret = BZ2_bzCompressInit ( &strm, blockSize100k, + ret = BZ2_bzCompressInit ( &strm, blockSize100k, verbosity, workFactor ); if (ret != BZ_OK) return ret; @@ -1457,7 +1465,7 @@ int BZ_API(BZ2_bzBuffToBuffCompress) if (ret != BZ_STREAM_END) goto errhandler; /* normal termination */ - *destLen -= strm.avail_out; + *destLen -= strm.avail_out; (void) BZ2_bzCompressEnd ( &strm ); return BZ_OK; @@ -1472,10 +1480,10 @@ int BZ_API(BZ2_bzBuffToBuffCompress) /*---------------------------------------------------*/ -int BZ_API(BZ2_bzBuffToBuffDecompress) - ( char* dest, +int BZ_API(BZ2_bzBuffToBuffDecompress) + ( char* dest, unsigned int* destLen, - char* source, + char* source, unsigned int sourceLen, int small, int verbosity ) @@ -1483,10 +1491,10 @@ int BZ_API(BZ2_bzBuffToBuffDecompress) bz_stream strm; int ret; - if (dest == NULL || destLen == NULL || + if (dest == NULL || destLen == NULL || source == NULL || (small != 0 && small != 1) || - verbosity < 0 || verbosity > 4) + verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; strm.bzalloc = NULL; @@ -1516,11 +1524,11 @@ int BZ_API(BZ2_bzBuffToBuffDecompress) } else { (void) BZ2_bzDecompressEnd ( &strm ); return BZ_OUTBUFF_FULL; - } + } errhandler: (void) BZ2_bzDecompressEnd ( &strm ); - return ret; + return ret; } @@ -1572,7 +1580,7 @@ BZFILE * bzopen_or_bzdopen int verbosity = 0; int workFactor = 30; int smallMode = 0; - int nUnused = 0; + int nUnused = 0; if (mode == NULL) return NULL; while (*mode) { @@ -1612,7 +1620,7 @@ BZFILE * bzopen_or_bzdopen if (writing) { /* Guard against total chaos and anarchy -- JRS */ if (blockSize100k < 1) blockSize100k = 1; - if (blockSize100k > 9) blockSize100k = 9; + if (blockSize100k > 9) blockSize100k = 9; bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, verbosity,workFactor); } else { @@ -1691,7 +1699,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b) { int bzerr; FILE *fp; - + if (b==NULL) {return;} fp = ((bzFile *)b)->handle; if(((bzFile*)b)->writing){ @@ -1710,7 +1718,7 @@ void BZ_API(BZ2_bzclose) (BZFILE* b) /*---------------------------------------------------*/ /*-- - return last error code + return last error code --*/ static const char *bzerrorstrings[] = { "OK" diff --git a/usr/src/common/bzip2/decompress.c b/usr/src/common/bzip2/decompress.c index d1da427b26..9a2f91695f 100644 --- a/usr/src/common/bzip2/decompress.c +++ b/usr/src/common/bzip2/decompress.c @@ -11,7 +11,7 @@ bzip2/libbzip2 version 1.0.6 of 6 September 2010 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org> - Please read the WARNING, DISCLAIMER and PATENTS sections in the + Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. This program is released under the terms of the license contained @@ -128,7 +128,7 @@ Int32 BZ2_decompress ( DState* s ) Int32 N; Int32 curr; Int32 zt; - Int32 zn; + Int32 zn; Int32 zvec; Int32 zj; Int32 gSel; @@ -182,7 +182,7 @@ Int32 BZ2_decompress ( DState* s ) N = s->save_N; curr = s->save_curr; zt = s->save_zt; - zn = s->save_zn; + zn = s->save_zn; zvec = s->save_zvec; zj = s->save_zj; gSel = s->save_gSel; @@ -205,14 +205,14 @@ Int32 BZ2_decompress ( DState* s ) if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC); GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8) - if (s->blockSize100k < (BZ_HDR_0 + 1) || + if (s->blockSize100k < (BZ_HDR_0 + 1) || s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC); s->blockSize100k -= BZ_HDR_0; if (s->smallDecompress) { s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); - s->ll4 = BZALLOC( - ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) + s->ll4 = BZALLOC( + ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) ); if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR); } else { @@ -238,7 +238,7 @@ Int32 BZ2_decompress ( DState* s ) s->currBlockNo++; if (s->verbosity >= 2) VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo ); - + s->storedBlockCRC = 0; GET_UCHAR(BZ_X_BCRC_1, uc); s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); @@ -261,14 +261,14 @@ Int32 BZ2_decompress ( DState* s ) if (s->origPtr < 0) RETURN(BZ_DATA_ERROR); - if (s->origPtr > 10 + 100000*s->blockSize100k) + if (s->origPtr > 10 + 100000*s->blockSize100k) RETURN(BZ_DATA_ERROR); /*--- Receive the mapping table ---*/ for (i = 0; i < 16; i++) { GET_BIT(BZ_X_MAPPING_1, uc); - if (uc == 1) - s->inUse16[i] = True; else + if (uc == 1) + s->inUse16[i] = True; else s->inUse16[i] = False; } @@ -304,7 +304,7 @@ Int32 BZ2_decompress ( DState* s ) { UChar pos[BZ_N_GROUPS], tmp, v; for (v = 0; v < nGroups; v++) pos[v] = v; - + for (i = 0; i < nSelectors; i++) { v = s->selectorMtf[i]; tmp = pos[v]; @@ -337,10 +337,10 @@ Int32 BZ2_decompress ( DState* s ) if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; if (s->len[t][i] < minLen) minLen = s->len[t][i]; } - BZ2_hbCreateDecodeTables ( - &(s->limit[t][0]), - &(s->base[t][0]), - &(s->perm[t][0]), + BZ2_hbCreateDecodeTables ( + &(s->limit[t][0]), + &(s->base[t][0]), + &(s->perm[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); @@ -439,23 +439,23 @@ Int32 BZ2_decompress ( DState* s ) s->mtfa[(z)-3] = s->mtfa[(z)-4]; nn -= 4; } - while (nn > 0) { - s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; + while (nn > 0) { + s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; }; s->mtfa[pp] = uc; - } else { + } else { /* general case */ lno = nn / MTFL_SIZE; off = nn % MTFL_SIZE; pp = s->mtfbase[lno] + off; uc = s->mtfa[pp]; - while (pp > s->mtfbase[lno]) { - s->mtfa[pp] = s->mtfa[pp-1]; pp--; + while (pp > s->mtfbase[lno]) { + s->mtfa[pp] = s->mtfa[pp-1]; pp--; }; s->mtfbase[lno]++; while (lno > 0) { s->mtfbase[lno]--; - s->mtfa[s->mtfbase[lno]] + s->mtfa[s->mtfbase[lno]] = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1]; lno--; } @@ -549,8 +549,9 @@ Int32 BZ2_decompress ( DState* s ) s->nblock_used = 0; if (s->blockRandomised) { BZ_RAND_INIT_MASK; - BZ_GET_SMALL(s->k0); s->nblock_used++; - BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; + BZ_GET_SMALL(s->k0); + s->nblock_used++; + BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; } else { BZ_GET_SMALL(s->k0); s->nblock_used++; } @@ -568,8 +569,9 @@ Int32 BZ2_decompress ( DState* s ) s->nblock_used = 0; if (s->blockRandomised) { BZ_RAND_INIT_MASK; - BZ_GET_FAST(s->k0); s->nblock_used++; - BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; + BZ_GET_FAST(s->k0); + s->nblock_used++; + BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; } else { BZ_GET_FAST(s->k0); s->nblock_used++; } @@ -638,7 +640,7 @@ Int32 BZ2_decompress ( DState* s ) s->save_gBase = gBase; s->save_gPerm = gPerm; - return retVal; + return retVal; } diff --git a/usr/src/uts/Makefile.uts b/usr/src/uts/Makefile.uts index 191bf0c74a..57597ad909 100644 --- a/usr/src/uts/Makefile.uts +++ b/usr/src/uts/Makefile.uts @@ -237,12 +237,6 @@ include $(SRC)/Makefile.smatch # SMOFF += sizeof -# -# DEBUG-only macros that define away to nothing confuse this check, -# unfortunately. -# -$(RELEASE_BUILD)SMOFF += indenting - CSTD = $(CSTD_GNU99) CFLAGS_uts = diff --git a/usr/src/uts/common/fs/zfs/spa.c b/usr/src/uts/common/fs/zfs/spa.c index 12af1fe811..835d830a27 100644 --- a/usr/src/uts/common/fs/zfs/spa.c +++ b/usr/src/uts/common/fs/zfs/spa.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2018 by Delphix. All rights reserved. + * Copyright (c) 2011, 2019 by Delphix. All rights reserved. * Copyright (c) 2015, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -4939,6 +4939,7 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props, spa->spa_removing_phys.sr_state = DSS_NONE; spa->spa_removing_phys.sr_removing_vdev = -1; spa->spa_removing_phys.sr_prev_indirect_vdev = -1; + spa->spa_indirect_vdevs_loaded = B_TRUE; /* * Create "The Godfather" zio to hold all async IOs diff --git a/usr/src/uts/common/io/comstar/port/srpt/srpt_impl.h b/usr/src/uts/common/io/comstar/port/srpt/srpt_impl.h index 17faa17087..76143c30bd 100644 --- a/usr/src/uts/common/io/comstar/port/srpt/srpt_impl.h +++ b/usr/src/uts/common/io/comstar/port/srpt/srpt_impl.h @@ -522,8 +522,8 @@ extern uint_t srpt_errlevel; cmn_err(CE_NOTE, __VA_ARGS__);\ } #else -#define SRPT_DPRINTF_L3(...) -#define SRPT_DPRINTF_L4(...) +#define SRPT_DPRINTF_L3(...) (void)(0) +#define SRPT_DPRINTF_L4(...) (void)(0) #endif #ifdef __cplusplus diff --git a/usr/src/uts/common/io/pciex/pcieb.h b/usr/src/uts/common/io/pciex/pcieb.h index fdb66a7844..0868458805 100644 --- a/usr/src/uts/common/io/pciex/pcieb.h +++ b/usr/src/uts/common/io/pciex/pcieb.h @@ -37,7 +37,7 @@ extern "C" { #define PCIEB_DEBUG pcieb_dbg extern void pcieb_dbg(uint_t bit, dev_info_t *dip, char *fmt, ...); #else /* DEBUG */ -#define PCIEB_DEBUG(...) +#define PCIEB_DEBUG(...) (void)(0) #endif /* DEBUG */ typedef enum { /* same sequence as pcieb_debug_sym[] */ diff --git a/usr/src/uts/common/io/qede/qede_main.c b/usr/src/uts/common/io/qede/qede_main.c index 0ebd3e45c9..60b632d11d 100644 --- a/usr/src/uts/common/io/qede/qede_main.c +++ b/usr/src/uts/common/io/qede/qede_main.c @@ -1108,22 +1108,9 @@ qede_alloc_intrs(qede_t *qede) /* Allocate an array big enough for maximum supported */ intr_ctx->intr_hdl_array = kmem_zalloc( intr_ctx->intr_hdl_array_size, KM_SLEEP); - if (intr_ctx->intr_hdl_array == NULL) { - cmn_err(CE_WARN, - "qede:%s: Failed to allocate" - " intr_ctx->intr_hdl_array\n", - __func__); - return (status); - } + intr_ctx->intr_vect_info = kmem_zalloc( intr_ctx->intr_vect_info_array_size, KM_SLEEP); - if (intr_ctx->intr_vect_info_array_size == NULL) { - cmn_err(CE_WARN, - "qede:%s: Failed to allocate" - " intr_ctx->vect_info_array_size\n", - __func__); - goto err_exit; - } /* * Use strict allocation. It will fail if we do not get diff --git a/usr/src/uts/common/io/qede/qede_version.h b/usr/src/uts/common/io/qede/qede_version.h index 8af00d182e..0ee38b4338 100644 --- a/usr/src/uts/common/io/qede/qede_version.h +++ b/usr/src/uts/common/io/qede/qede_version.h @@ -39,6 +39,6 @@ #define MAJVERSION 8 #define MINVERSION 1 -#define REVVERSION 24 +#define REVVERSION 25 #endif /* !_QEDE_VERSION_H */ diff --git a/usr/src/uts/common/sys/ib/clients/eoib/eib_impl.h b/usr/src/uts/common/sys/ib/clients/eoib/eib_impl.h index 98788661ca..1b65559ad6 100644 --- a/usr/src/uts/common/sys/ib/clients/eoib/eib_impl.h +++ b/usr/src/uts/common/sys/ib/clients/eoib/eib_impl.h @@ -92,10 +92,10 @@ extern "C" { #define EIB_DPRINTF_PKT eib_dprintf_pkt #define EIB_DPRINTF_VERBOSE eib_dprintf_verbose #else -#define EIB_DPRINTF_DEBUG(...) -#define EIB_DPRINTF_ARGS(...) -#define EIB_DPRINTF_PKT(...) -#define EIB_DPRINTF_VERBOSE(...) +#define EIB_DPRINTF_DEBUG(...) (void)(0) +#define EIB_DPRINTF_ARGS(...) (void)(0) +#define EIB_DPRINTF_PKT(...) (void)(0) +#define EIB_DPRINTF_VERBOSE(...) (void)(0) #endif /* diff --git a/usr/src/uts/common/sys/ib/clients/eoib/enx_impl.h b/usr/src/uts/common/sys/ib/clients/eoib/enx_impl.h index 9e5b3486b2..14447c2582 100644 --- a/usr/src/uts/common/sys/ib/clients/eoib/enx_impl.h +++ b/usr/src/uts/common/sys/ib/clients/eoib/enx_impl.h @@ -75,9 +75,9 @@ extern "C" { #define ENX_DPRINTF_ARGS eibnx_dprintf_args #define ENX_DPRINTF_VERBOSE eibnx_dprintf_verbose #else -#define ENX_DPRINTF_DEBUG(...) -#define ENX_DPRINTF_ARGS(...) -#define ENX_DPRINTF_VERBOSE(...) +#define ENX_DPRINTF_DEBUG(...) (void)(0) +#define ENX_DPRINTF_ARGS(...) (void)(0) +#define ENX_DPRINTF_VERBOSE(...) (void)(0) #endif /* diff --git a/usr/src/uts/common/sys/ib/clients/rds/rdsib_debug.h b/usr/src/uts/common/sys/ib/clients/rds/rdsib_debug.h index b6208fbf59..e327c03680 100644 --- a/usr/src/uts/common/sys/ib/clients/rds/rdsib_debug.h +++ b/usr/src/uts/common/sys/ib/clients/rds/rdsib_debug.h @@ -101,10 +101,10 @@ void rds_dprintf3( char *name, char *fmt, ...); #else -#define RDS_DPRINTF_INTR(...) -#define RDS_DPRINTF5(...) -#define RDS_DPRINTF4(...) -#define RDS_DPRINTF3(...) +#define RDS_DPRINTF_INTR(...) (void)(0) +#define RDS_DPRINTF5(...) (void)(0) +#define RDS_DPRINTF4(...) (void)(0) +#define RDS_DPRINTF3(...) (void)(0) #endif #define RDS_DPRINTF2 rds_dprintf2 diff --git a/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h b/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h index 272050476e..a32de1169e 100644 --- a/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h +++ b/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_debug.h @@ -100,10 +100,10 @@ void rdsv3_dprintf3( char *name, char *fmt, ...); #else -#define RDSV3_DPRINTF_INTR(...) -#define RDSV3_DPRINTF5(...) -#define RDSV3_DPRINTF4(...) -#define RDSV3_DPRINTF3(...) +#define RDSV3_DPRINTF_INTR(...) (void)(0) +#define RDSV3_DPRINTF5(...) (void)(0) +#define RDSV3_DPRINTF4(...) (void)(0) +#define RDSV3_DPRINTF3(...) (void)(0) #endif #define RDSV3_DPRINTF2 rdsv3_dprintf2 diff --git a/usr/src/uts/common/sys/ib/ibtl/impl/ibtl_util.h b/usr/src/uts/common/sys/ib/ibtl/impl/ibtl_util.h index c7a5d1d088..c49b06a074 100644 --- a/usr/src/uts/common/sys/ib/ibtl/impl/ibtl_util.h +++ b/usr/src/uts/common/sys/ib/ibtl/impl/ibtl_util.h @@ -133,10 +133,10 @@ void ibtl_dprintf3( char *name, char *fmt, ...); #else -#define IBTF_DPRINTF_LINTR(...) -#define IBTF_DPRINTF_L5(...) -#define IBTF_DPRINTF_L4(...) -#define IBTF_DPRINTF_L3(...) +#define IBTF_DPRINTF_LINTR(...) (void)(0) +#define IBTF_DPRINTF_L5(...) (void)(0) +#define IBTF_DPRINTF_L4(...) (void)(0) +#define IBTF_DPRINTF_L3(...) (void)(0) #endif #define IBTF_DPRINTF_L2 ibtl_dprintf2 diff --git a/usr/src/uts/common/sys/pcie_impl.h b/usr/src/uts/common/sys/pcie_impl.h index 9d433c5afb..faebc9d020 100644 --- a/usr/src/uts/common/sys/pcie_impl.h +++ b/usr/src/uts/common/sys/pcie_impl.h @@ -529,11 +529,11 @@ typedef struct { #else /* DEBUG */ -#define PCIE_DBG_CFG(...) -#define PCIE_DBG(...) -#define PCIE_ARI_DBG(...) -#define PCIE_DBG_CAP(...) -#define PCIE_DBG_AER(...) +#define PCIE_DBG_CFG(...) (void)(0) +#define PCIE_DBG(...) (void)(0) +#define PCIE_ARI_DBG(...) (void)(0) +#define PCIE_DBG_CAP(...) (void)(0) +#define PCIE_DBG_AER(...) (void)(0) #endif /* DEBUG */ diff --git a/usr/src/uts/common/sys/usb/scsa2usb/scsa2usb.h b/usr/src/uts/common/sys/usb/scsa2usb/scsa2usb.h index c4abe6f9aa..32de7e6eca 100644 --- a/usr/src/uts/common/sys/usb/scsa2usb/scsa2usb.h +++ b/usr/src/uts/common/sys/usb/scsa2usb/scsa2usb.h @@ -655,7 +655,7 @@ typedef struct scsa2usb_read_cap { #ifdef DEBUG #define SCSA2USB_PRINT_CDB scsa2usb_print_cdb #else -#define SCSA2USB_PRINT_CDB(...) +#define SCSA2USB_PRINT_CDB(...) (void)(0) #endif /* ugen support */ diff --git a/usr/src/uts/i86pc/io/apix/apix.c b/usr/src/uts/i86pc/io/apix/apix.c index 2e65435d90..c87abc8ea5 100644 --- a/usr/src/uts/i86pc/io/apix/apix.c +++ b/usr/src/uts/i86pc/io/apix/apix.c @@ -325,7 +325,7 @@ apix_softinit() iptr = (int *)&apic_irq_table[0]; for (i = 0; i <= APIC_MAX_VECTOR; i++) { apic_level_intr[i] = 0; - *iptr++ = NULL; + *iptr++ = 0; } mutex_init(&airq_mutex, NULL, MUTEX_DEFAULT, NULL); @@ -357,7 +357,7 @@ apix_get_intr_handler(int cpu, short vec) ASSERT(cpu < apic_nproc && vec < APIX_NVECTOR); if (cpu >= apic_nproc || vec >= APIX_NVECTOR) - return (NULL); + return (0); apix_vector = apixs[cpu]->x_vectbl[vec]; diff --git a/usr/src/uts/i86pc/io/pcplusmp/apic_common.c b/usr/src/uts/i86pc/io/pcplusmp/apic_common.c index 3e5eb92067..65cdcaf763 100644 --- a/usr/src/uts/i86pc/io/pcplusmp/apic_common.c +++ b/usr/src/uts/i86pc/io/pcplusmp/apic_common.c @@ -386,10 +386,10 @@ apic_cmci_setup(processorid_t cpuid, boolean_t enable) CPUSET_ONLY(cpu_set, cpuid); if (enable) { - xc_call(NULL, NULL, NULL, CPUSET2BV(cpu_set), + xc_call(0, 0, 0, CPUSET2BV(cpu_set), (xc_func_t)apic_cmci_enable); } else { - xc_call(NULL, NULL, NULL, CPUSET2BV(cpu_set), + xc_call(0, 0, 0, CPUSET2BV(cpu_set), (xc_func_t)apic_cmci_disable); } } diff --git a/usr/src/uts/i86pc/io/ppm/acpisleep.c b/usr/src/uts/i86pc/io/ppm/acpisleep.c index f2eb080f48..41cd3800b7 100644 --- a/usr/src/uts/i86pc/io/ppm/acpisleep.c +++ b/usr/src/uts/i86pc/io/ppm/acpisleep.c @@ -87,7 +87,7 @@ acpi_enter_sleepstate(s3a_t *s3ap) PT(PT_SWV); /* Set waking vector */ - if (AcpiSetFirmwareWakingVector(wakephys, NULL) != AE_OK) { + if (AcpiSetFirmwareWakingVector(wakephys, 0) != AE_OK) { PT(PT_SWV_FAIL); PMD(PMD_SX, ("Can't SetFirmwareWakingVector(%lx)\n", (long)wakephys)) |