Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 4fffd6c

Browse files
enh-googleGerrit Code Review
authored andcommitted
Merge "printf implementation: add missing const to padding strings." into main
2 parents 2e6b77a + 9e74d10 commit 4fffd6c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

libc/stdio/vfprintf.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#define PRINT(ptr, len) \
4545
do { \
46-
iovp->iov_base = (ptr); \
46+
iovp->iov_base = (void*)(ptr); \
4747
iovp->iov_len = (len); \
4848
uio.uio_resid += (len); \
4949
iovp++; \
@@ -125,10 +125,10 @@ int FUNCTION_NAME(FILE* fp, const CHAR_TYPE* fmt0, va_list ap) {
125125
* below longer.
126126
*/
127127
#define PADSIZE 16 /* pad chunk size */
128-
static CHAR_TYPE blanks[PADSIZE] = {
128+
static const CHAR_TYPE blanks[PADSIZE] = {
129129
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
130130
};
131-
static CHAR_TYPE zeroes[PADSIZE] = {
131+
static const CHAR_TYPE zeroes[PADSIZE] = {
132132
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'
133133
};
134134

libc/stdio/vfwprintf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ int FUNCTION_NAME(FILE* fp, const CHAR_TYPE* fmt0, va_list ap) {
128128
* below longer.
129129
*/
130130
#define PADSIZE 16 /* pad chunk size */
131-
static CHAR_TYPE blanks[PADSIZE] = {
131+
static const CHAR_TYPE blanks[PADSIZE] = {
132132
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
133133
};
134-
static CHAR_TYPE zeroes[PADSIZE] = {
134+
static const CHAR_TYPE zeroes[PADSIZE] = {
135135
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'
136136
};
137137

0 commit comments

Comments
 (0)