浏览代码

lavu: add av_scanf_format() and use it on av_sscanf()

Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Jacob Lifshay 4 月之前
父节点
当前提交
157d3b007e
共有 4 个文件被更改,包括 7 次插入2 次删除
  1. 3 0
      doc/APIchanges
  2. 2 0
      libavutil/attributes.h
  3. 1 1
      libavutil/avstring.h
  4. 1 1
      libavutil/version.h

+ 3 - 0
doc/APIchanges

@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
 
 
 API changes, most recent first:
 API changes, most recent first:
 
 
+2025-07-20 - xxxxxxxxxx - lavu 60.6.100 - attributes.h, avstring.h
+  Add av_scanf_format() and use it on av_sscanf().
+
 2025-07-18 - xxxxxxxxxx - lavu 60.5.100 - pixfmt.h
 2025-07-18 - xxxxxxxxxx - lavu 60.5.100 - pixfmt.h
   Add AV_PIX_FMT_OHCODEC.
   Add AV_PIX_FMT_OHCODEC.
 
 

+ 2 - 0
libavutil/attributes.h

@@ -159,9 +159,11 @@
 #if defined(__GNUC__) || defined(__clang__)
 #if defined(__GNUC__) || defined(__clang__)
 #    define av_builtin_constant_p __builtin_constant_p
 #    define av_builtin_constant_p __builtin_constant_p
 #    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
 #    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
+#    define av_scanf_format(fmtpos, attrpos) __attribute__((__format__(__scanf__, fmtpos, attrpos)))
 #else
 #else
 #    define av_builtin_constant_p(x) 0
 #    define av_builtin_constant_p(x) 0
 #    define av_printf_format(fmtpos, attrpos)
 #    define av_printf_format(fmtpos, attrpos)
+#    define av_scanf_format(fmtpos, attrpos)
 #endif
 #endif
 
 
 #if AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)
 #if AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)

+ 1 - 1
libavutil/avstring.h

@@ -419,7 +419,7 @@ int av_match_list(const char *name, const char *list, char separator);
  * See libc sscanf manual for more information.
  * See libc sscanf manual for more information.
  * Locale-independent sscanf implementation.
  * Locale-independent sscanf implementation.
  */
  */
-int av_sscanf(const char *string, const char *format, ...);
+int av_sscanf(const char *string, const char *format, ...) av_scanf_format(2, 3);
 
 
 /**
 /**
  * @}
  * @}

+ 1 - 1
libavutil/version.h

@@ -79,7 +79,7 @@
  */
  */
 
 
 #define LIBAVUTIL_VERSION_MAJOR  60
 #define LIBAVUTIL_VERSION_MAJOR  60
-#define LIBAVUTIL_VERSION_MINOR   5
+#define LIBAVUTIL_VERSION_MINOR   6
 #define LIBAVUTIL_VERSION_MICRO 100
 #define LIBAVUTIL_VERSION_MICRO 100
 
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \