Skip to content

Commit d51c5eb

Browse files
committed
ggml : define MIN / MAX only if not defined (minor)
1 parent 0be6a1a commit d51c5eb

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

ggml.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ typedef void* thread_ret_t;
8888
#define GGML_MEM_ALIGN 16
8989
#endif
9090

91-
#define MAX(a, b) ((a) > (b) ? (a) : (b))
92-
#define MIN(a, b) ((a) < (b) ? (a) : (b))
93-
9491
#define UNUSED(x) (void)(x)
9592
#define SWAP(x, y, T) do { T SWAP = x; x = y; y = SWAP; } while (0)
9693

@@ -108,6 +105,11 @@ typedef void* thread_ret_t;
108105
#include <cblas.h>
109106
#endif
110107

108+
#undef MIN
109+
#undef MAX
110+
#define MIN(a, b) ((a) < (b) ? (a) : (b))
111+
#define MAX(a, b) ((a) > (b) ? (a) : (b))
112+
111113
// floating point type used to accumulate sums
112114
typedef double ggml_float;
113115

whisper.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,8 @@ struct whisper_context {
435435
};
436436

437437
template<typename T>
438-
static void read_safe(std::ifstream& fin, T& dest)
439-
{
440-
fin.read((char*)& dest, sizeof(T));
438+
static void read_safe(std::ifstream& fin, T& dest) {
439+
fin.read((char*)& dest, sizeof(T));
441440
}
442441

443442
// load the model from a ggml file

whisper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ extern "C" {
148148
struct whisper_context * ctx,
149149
const char * text,
150150
whisper_token * tokens,
151-
int n_max_tokens);
151+
int n_max_tokens);
152152

153153
// Largest language id (i.e. number of available languages - 1)
154154
WHISPER_API int whisper_lang_max_id();

0 commit comments

Comments
 (0)