[pulseaudio-commits] r1259 - in /trunk/src/pulse: sample.c sample.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Aug 17 13:02:47 PDT 2006


Author: lennart
Date: Thu Aug 17 22:02:46 2006
New Revision: 1259

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1259&root=pulseaudio&view=rev
Log:
modify pa_bytes_snprint() to return the string we just wrote to. This should be binary compat with older versions which returned void

Modified:
    trunk/src/pulse/sample.c
    trunk/src/pulse/sample.h

Modified: trunk/src/pulse/sample.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/sample.c?rev=1259&root=pulseaudio&r1=1258&r2=1259&view=diff
==============================================================================
--- trunk/src/pulse/sample.c (original)
+++ trunk/src/pulse/sample.c Thu Aug 17 22:02:46 2006
@@ -120,7 +120,7 @@
     return s;
 }
 
-void pa_bytes_snprint(char *s, size_t l, unsigned v) {
+char* pa_bytes_snprint(char *s, size_t l, unsigned v) {
     if (v >= ((unsigned) 1024)*1024*1024)
         snprintf(s, l, "%0.1f GiB", ((double) v)/1024/1024/1024);
     else if (v >= ((unsigned) 1024)*1024)
@@ -129,6 +129,8 @@
         snprintf(s, l, "%0.1f KiB", ((double) v)/1024);
     else
         snprintf(s, l, "%u B", (unsigned) v);
+
+    return s;
 }
 
 pa_sample_format_t pa_parse_sample_format(const char *format) {

Modified: trunk/src/pulse/sample.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/sample.h?rev=1259&root=pulseaudio&r1=1258&r2=1259&view=diff
==============================================================================
--- trunk/src/pulse/sample.h (original)
+++ trunk/src/pulse/sample.h Thu Aug 17 22:02:46 2006
@@ -182,7 +182,7 @@
 char* pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec);
 
 /** Pretty print a byte size value. (i.e. "2.5 MiB") */
-void pa_bytes_snprint(char *s, size_t l, unsigned v);
+char* pa_bytes_snprint(char *s, size_t l, unsigned v);
 
 PA_C_DECL_END
 




More information about the pulseaudio-commits mailing list