ext/zstdruby/libzstd/dictBuilder/cover.c in zstd-ruby-1.3.0.0 vs ext/zstdruby/libzstd/dictBuilder/cover.c in zstd-ruby-1.3.1.0
- old
+ new
@@ -1,12 +1,12 @@
-/**
+/*
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under both the BSD-style license (found in the
+ * LICENSE file in the root directory of this source tree) and the GPLv2 (found
+ * in the COPYING file in the root directory of this source tree).
*/
/* *****************************************************************************
* Constructs a dictionary using a heuristic based on the following paper:
*
@@ -712,14 +712,12 @@
/**
* Initialize the `COVER_best_t`.
*/
static void COVER_best_init(COVER_best_t *best) {
- if (!best) {
- return;
- }
- pthread_mutex_init(&best->mutex, NULL);
- pthread_cond_init(&best->cond, NULL);
+ if (best==NULL) return; /* compatible with init on NULL */
+ (void)pthread_mutex_init(&best->mutex, NULL);
+ (void)pthread_cond_init(&best->cond, NULL);
best->liveJobs = 0;
best->dict = NULL;
best->dictSize = 0;
best->compressedSize = (size_t)-1;
memset(&best->parameters, 0, sizeof(best->parameters));