Skip to content

Commit

Permalink
Squashed 'src/c-blosc2/' changes from 97ac7964f..edcf96d4f
Browse files Browse the repository at this point in the history
edcf96d4f Getting ready for release 2.13.1
22177bca1 Remove include blosc-private.h in b2nd.h
ef531a46b Revert grok inizialization from c-blosc2
54a23bfbb Move back swap_store from blosc-private.h to blosc2.h
c6e8bf60a Post 2.13.0 release actions done

git-subtree-dir: src/c-blosc2
git-subtree-split: edcf96d4f1d288db3849abae60c1721ee40e881d
  • Loading branch information
t20100 committed Jan 30, 2024
1 parent b9c7d6b commit 67b5370
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 54 deletions.
7 changes: 2 additions & 5 deletions ANNOUNCE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Announcing C-Blosc2 2.13.0
# Announcing C-Blosc2 2.13.1
A fast, compressed and persistent binary data store library for C.

## What is new?

A new filter for truncating integers has been added. Furthermore, the zstd codec
has been optimized specially when using dicts. And finally, the grok library
will be initialized when loading the plugin. This evicts having to import it in
some use cases.
This is a patch release for fixing a bug regarding the included files in `b2nd.h`.

For more info, please see the release notes in:

Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release notes for C-Blosc2
==========================

Changes from 2.13.0 to 2.13.1
=============================

* Removed private include in `b2nd.h`. This fixes issue #579.


Changes from 2.12.0 to 2.13.0
=============================

Expand Down
40 changes: 0 additions & 40 deletions blosc/blosc-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,45 +274,5 @@ static inline void* load_lib(char *plugin_name, char *libpath) {
return loaded_lib;
}

static inline void swap_store(void *dest, const void *pa, int size) {
uint8_t *pa_ = (uint8_t *) pa;
uint8_t *pa2_ = (uint8_t*)malloc((size_t) size);
int i = 1; /* for big/little endian detection */
char *p = (char *) &i;

if (p[0] == 1) {
/* little endian */
switch (size) {
case 8:
pa2_[0] = pa_[7];
pa2_[1] = pa_[6];
pa2_[2] = pa_[5];
pa2_[3] = pa_[4];
pa2_[4] = pa_[3];
pa2_[5] = pa_[2];
pa2_[6] = pa_[1];
pa2_[7] = pa_[0];
break;
case 4:
pa2_[0] = pa_[3];
pa2_[1] = pa_[2];
pa2_[2] = pa_[1];
pa2_[3] = pa_[0];
break;
case 2:
pa2_[0] = pa_[1];
pa2_[1] = pa_[0];
break;
case 1:
pa2_[0] = pa_[0];
break;
default:
fprintf(stderr, "Unhandled nitems: %d\n", size);
}
}
memcpy(dest, pa2_, size);
free(pa2_);
}


#endif /* BLOSC_BLOSC_PRIVATE_H */
5 changes: 0 additions & 5 deletions blosc/blosc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,11 +843,6 @@ int fill_codec(blosc2_codec *codec) {
dlclose(lib);
return BLOSC2_ERROR_FAILURE;
}
if (codec->compcode == BLOSC_CODEC_GROK) {
// Initialize grok lib
void (*init_func)(uint32_t, bool) = dlsym(lib, "blosc2_grok_init");
(*init_func)(0, false);
}

return BLOSC2_ERROR_SUCCESS;
}
Expand Down
1 change: 0 additions & 1 deletion include/b2nd.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern "C" {
#endif

#include "blosc2.h"
#include "blosc-private.h"

#include <stdio.h>
#include <stdlib.h>
Expand Down
48 changes: 45 additions & 3 deletions include/blosc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ extern "C" {
/* Version numbers */
#define BLOSC2_VERSION_MAJOR 2 /* for major interface/format changes */
#define BLOSC2_VERSION_MINOR 13 /* for minor interface/format changes */
#define BLOSC2_VERSION_RELEASE 0 /* for tweaks, bug-fixes, or development */
#define BLOSC2_VERSION_RELEASE 1 /* for tweaks, bug-fixes, or development */

#define BLOSC2_VERSION_STRING "2.13.0" /* string version. Sync with above! */
#define BLOSC2_VERSION_DATE "$Date:: 2023-01-24 #$" /* date version */
#define BLOSC2_VERSION_STRING "2.13.1" /* string version. Sync with above! */
#define BLOSC2_VERSION_DATE "$Date:: 2023-01-25 #$" /* date version */


/* The maximum number of dimensions for Blosc2 NDim arrays */
Expand Down Expand Up @@ -2504,6 +2504,48 @@ BLOSC_EXPORT void blosc2_multidim_to_unidim(const int64_t *index, int8_t ndim, c
*/
BLOSC_EXPORT int blosc2_get_slice_nchunks(blosc2_schunk* schunk, int64_t *start, int64_t *stop, int64_t **chunks_idx);


// Private function needed in b2nd.h for deserializing meta
static inline void swap_store(void *dest, const void *pa, int size) {
uint8_t *pa_ = (uint8_t *) pa;
uint8_t *pa2_ = (uint8_t*)malloc((size_t) size);
int i = 1; /* for big/little endian detection */
char *p = (char *) &i;

if (p[0] == 1) {
/* little endian */
switch (size) {
case 8:
pa2_[0] = pa_[7];
pa2_[1] = pa_[6];
pa2_[2] = pa_[5];
pa2_[3] = pa_[4];
pa2_[4] = pa_[3];
pa2_[5] = pa_[2];
pa2_[6] = pa_[1];
pa2_[7] = pa_[0];
break;
case 4:
pa2_[0] = pa_[3];
pa2_[1] = pa_[2];
pa2_[2] = pa_[1];
pa2_[3] = pa_[0];
break;
case 2:
pa2_[0] = pa_[1];
pa2_[1] = pa_[0];
break;
case 1:
pa2_[0] = pa_[0];
break;
default:
fprintf(stderr, "Unhandled nitems: %d\n", size);
}
}
memcpy(dest, pa2_, size);
free(pa2_);
}

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 67b5370

Please sign in to comment.