Skip to content

Commit b3a5b5b

Browse files
committed
os: drop unused Xscnprintf() and Xvscnprintf()
Not used anywhere (not even in drivers), so no need to keep them anymore. Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
1 parent 0c7799b commit b3a5b5b

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

include/Xprintf.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,4 @@ extern _X_EXPORT int
5555
XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va)
5656
_X_ATTRIBUTE_PRINTF(2, 0);
5757

58-
/*
59-
* These functions provide a portable implementation of the linux kernel
60-
* scnprintf & vscnprintf routines that return the number of bytes actually
61-
* copied during a snprintf, (excluding the final '\0').
62-
*/
63-
extern _X_EXPORT int
64-
Xscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, ...)
65-
_X_ATTRIBUTE_PRINTF(3,4);
66-
extern _X_EXPORT int
67-
Xvscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, va_list va)
68-
_X_ATTRIBUTE_PRINTF(3,0);
69-
7058
#endif /* XPRINTF_H */

os/xprintf.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -111,47 +111,3 @@ XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD format, ...)
111111
va_end(va);
112112
return size;
113113
}
114-
115-
/**
116-
* Varargs snprintf that returns the actual number of bytes (excluding final
117-
* '\0') that were copied into the buffer.
118-
* This is opposed to the normal sprintf() usually returns the number of bytes
119-
* that would have been written.
120-
*
121-
* @param s buffer to copy into
122-
* @param n size of buffer s
123-
* @param format printf style format string
124-
* @param va variable argument list
125-
* @return number of bytes actually copied, excluding final '\0'
126-
*/
127-
int
128-
Xvscnprintf(char *s, int n, const char *format, va_list args)
129-
{
130-
int x;
131-
if (n == 0)
132-
return 0;
133-
x = vsnprintf(s, n , format, args);
134-
return (x >= n) ? (n - 1) : x;
135-
}
136-
137-
/**
138-
* snprintf that returns the actual number of bytes (excluding final '\0') that
139-
* were copied into the buffer.
140-
* This is opposed to the normal sprintf() usually returns the number of bytes
141-
* that would have been written.
142-
*
143-
* @param s buffer to copy into
144-
* @param n size of buffer s
145-
* @param format printf style format string
146-
* @param ... arguments for specified format
147-
* @return number of bytes actually copied, excluding final '\0'
148-
*/
149-
int Xscnprintf(char *s, int n, const char *format, ...)
150-
{
151-
int x;
152-
va_list ap;
153-
va_start(ap, format);
154-
x = Xvscnprintf(s, n, format, ap);
155-
va_end(ap);
156-
return x;
157-
}

0 commit comments

Comments
 (0)