Skip to content

Commit 422d8b8

Browse files
committed
Use fixed-width integer types for MY_TYPE in examples for clarity and future compatibility
1 parent adf2812 commit 422d8b8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tests/duplex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#include <cstring>
1515

1616
/*
17-
typedef char MY_TYPE;
17+
typedef int8_t MY_TYPE;
1818
#define FORMAT RTAUDIO_SINT8
1919
*/
2020

21-
typedef signed short MY_TYPE;
21+
typedef int16_t MY_TYPE;
2222
#define FORMAT RTAUDIO_SINT16
2323

2424
/*

tests/playraw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#include <stdio.h>
1717

1818
/*
19-
typedef char MY_TYPE;
19+
typedef int8_t MY_TYPE;
2020
#define FORMAT RTAUDIO_SINT8
2121
#define SCALE 127.0
2222
*/
2323

24-
typedef signed short MY_TYPE;
24+
typedef int16_t MY_TYPE;
2525
#define FORMAT RTAUDIO_SINT16
2626
#define SCALE 32767.0
2727

@@ -30,7 +30,7 @@ typedef S24 MY_TYPE;
3030
#define FORMAT RTAUDIO_SINT24
3131
#define SCALE 8388607.0
3232
33-
typedef signed int MY_TYPE;
33+
typedef int32_t MY_TYPE;
3434
#define FORMAT RTAUDIO_SINT32
3535
#define SCALE 2147483647.0
3636

tests/playsaw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
#include <signal.h>
1515

1616
/*
17-
typedef char MY_TYPE;
17+
typedef int8_t MY_TYPE;
1818
#define FORMAT RTAUDIO_SINT8
1919
#define SCALE 127.0
2020
*/
2121

22-
typedef signed short MY_TYPE;
22+
typedef int16_t MY_TYPE;
2323
#define FORMAT RTAUDIO_SINT16
2424
#define SCALE 32767.0
2525

tests/record.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
#include <stdio.h>
1717

1818
/*
19-
typedef char MY_TYPE;
19+
typedef int8_t MY_TYPE;
2020
#define FORMAT RTAUDIO_SINT8
2121
*/
2222

23-
typedef signed short MY_TYPE;
23+
typedef int16_t MY_TYPE;
2424
#define FORMAT RTAUDIO_SINT16
2525

2626
/*

0 commit comments

Comments
 (0)