Skip to content

Commit

Permalink
Merge branch 'openslide:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
josiah-lunit authored Sep 4, 2023
2 parents a34c1ed + 239d7bd commit 8e07e46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
8 changes: 4 additions & 4 deletions src/openslide-decode-tifflike.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ static bool populate_item(struct _openslide_tifflike *tl,
}

uint64_t count = item->count;
int32_t value_size = get_value_size(item->type, &count);
uint32_t value_size = get_value_size(item->type, &count);
g_assert(value_size);
ssize_t len = value_size * count;
size_t len = value_size * count;

g_autofree void *buf = g_try_malloc(len);
if (buf == NULL) {
Expand All @@ -341,12 +341,12 @@ static bool populate_item(struct _openslide_tifflike *tl,
return false;
}

//g_debug("reading tiff value: len: %"PRId64", offset %"PRIu64, len, item->offset);
//g_debug("reading tiff value: len: %"PRIu64", offset %"PRIu64, len, item->offset);
if (!_openslide_fseek(f, item->offset, SEEK_SET, err)) {
g_prefix_error(err, "Couldn't seek to read TIFF value: ");
return false;
}
if (_openslide_fread(f, buf, len) != (size_t) len) {
if (_openslide_fread(f, buf, len) != len) {
g_set_error(err, OPENSLIDE_ERROR, OPENSLIDE_ERROR_FAILED,
"Couldn't read TIFF value");
return false;
Expand Down
20 changes: 0 additions & 20 deletions src/openslide-features.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@
#define OPENSLIDE_OPENSLIDE_FEATURES_H_


#ifndef __cplusplus
# ifdef _MSC_VER
# ifndef bool
# define bool unsigned char
# endif
# ifndef true
# define true 1
# endif
# ifndef false
# define false 0
# endif
# ifndef __bool_true_false_are_defined
# define __bool_true_false_are_defined 1
# endif
# else
# include <stdbool.h>
# endif
#endif


// for exporting from shared libraries or DLLs
#if defined _WIN32
# ifdef _OPENSLIDE_BUILDING_DLL
Expand Down
1 change: 1 addition & 0 deletions src/openslide.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit 8e07e46

Please sign in to comment.