/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Provides a safer sprintf for printing to fixed-size character arrays. */
MOZ_FORMAT_PRINTF(3, 4)
MOZ_MAYBE_UNUSED staticint SprintfBuf(char* buffer, size_t bufsize, constchar* format, ...) {
va_list args;
va_start(args, format); int result = VsprintfBuf(buffer, bufsize, format, args);
va_end(args); return result;
}
template <size_t N>
MOZ_FORMAT_PRINTF(2, 0) int VsprintfLiteral(char (&buffer)[N], constchar* format, va_list args) { return VsprintfBuf(buffer, N, format, args);
}
template <size_t N>
MOZ_FORMAT_PRINTF(2, 3) int SprintfLiteral(char (&buffer)[N], constchar* format, ...) {
va_list args;
va_start(args, format); int result = VsprintfLiteral(buffer, format, args);
va_end(args); return result;
}
#endif #endif/* mozilla_Sprintf_h_ */
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.