Skip to content

Commit

Permalink
Use fixed-width integer types for MY_TYPE in examples for clarity and…
Browse files Browse the repository at this point in the history
… future compatibility
  • Loading branch information
giuliomoro committed Feb 2, 2024
1 parent adf2812 commit 422d8b8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/duplex.cpp
Expand Up @@ -14,11 +14,11 @@
#include <cstring>

/*
typedef char MY_TYPE;
typedef int8_t MY_TYPE;
#define FORMAT RTAUDIO_SINT8
*/

typedef signed short MY_TYPE;
typedef int16_t MY_TYPE;
#define FORMAT RTAUDIO_SINT16

/*
Expand Down
6 changes: 3 additions & 3 deletions tests/playraw.cpp
Expand Up @@ -16,12 +16,12 @@
#include <stdio.h>

/*
typedef char MY_TYPE;
typedef int8_t MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
*/

typedef signed short MY_TYPE;
typedef int16_t MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0

Expand All @@ -30,7 +30,7 @@ typedef S24 MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 8388607.0
typedef signed int MY_TYPE;
typedef int32_t MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
Expand Down
4 changes: 2 additions & 2 deletions tests/playsaw.cpp
Expand Up @@ -14,12 +14,12 @@
#include <signal.h>

/*
typedef char MY_TYPE;
typedef int8_t MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
*/

typedef signed short MY_TYPE;
typedef int16_t MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0

Expand Down
4 changes: 2 additions & 2 deletions tests/record.cpp
Expand Up @@ -16,11 +16,11 @@
#include <stdio.h>

/*
typedef char MY_TYPE;
typedef int8_t MY_TYPE;
#define FORMAT RTAUDIO_SINT8
*/

typedef signed short MY_TYPE;
typedef int16_t MY_TYPE;
#define FORMAT RTAUDIO_SINT16

/*
Expand Down

0 comments on commit 422d8b8

Please sign in to comment.