From: Gwenole Beauchesne Date: Thu, 2 Jul 2009 09:15:58 +0000 (+0000) Subject: Fix build of vainfo. X-Git-Tag: 20091130_Alpha4~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F419%2F1;p=profile%2Fivi%2Flibva.git Fix build of vainfo. commit f8aebf54e0d6b2411cb495f9fab71dc8a05c245c Author: Gwenole Beauchesne Date: Thu Jun 25 14:06:38 2009 +0000 Further fixes to vainfo: use strrchr() instead of rindex(), make profile_string() and entrypoint_string() always return a value. commit 4e6d19d5588998b5a9da30500ce727410b5787ef Author: Gwenole Beauchesne Date: Wed Jun 24 12:43:55 2009 +0000 Fix vainfo error messages. Signed-off-by: Austin Yuan --- diff --git a/test/Makefile.am b/test/Makefile.am index 37b3f06..6554962 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -23,7 +23,7 @@ check_PROGRAMS = test_01 test_02 test_03 test_04 test_05 test_06 \ test_07 test_08 test_09 test_10 test_11 test_12 -bin_PROGRAMS = +bin_PROGRAMS = vainfo testdir = $(bindir) diff --git a/test/vainfo.c b/test/vainfo.c index a886815..ed05881 100644 --- a/test/vainfo.c +++ b/test/vainfo.c @@ -22,7 +22,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include @@ -32,7 +32,7 @@ #define CHECK_VASTATUS(va_status,func, ret) \ if (va_status != VA_STATUS_SUCCESS) { \ - fprintf(stderr,"%s failed with error code %d (%s),exit\n",func, vaErrorStr(va_status)); \ + fprintf(stderr,"%s failed with error code %d (%s),exit\n",func, va_status, vaErrorStr(va_status)); \ exit(ret); \ } @@ -52,6 +52,7 @@ static char * profile_string(VAProfile profile) case VAProfileVC1Advanced: return "VAProfileVC1Advanced"; case VAProfileH263Baseline: return "VAProfileH263Baseline"; } + return ""; } @@ -65,6 +66,7 @@ static char * entrypoint_string(VAEntrypoint entrypoint) case VAEntrypointDeblocking:return "VAEntrypointDeblocking"; case VAEntrypointEncSlice:return "VAEntrypointEncSlice"; } + return ""; } int main(int argc, const char* argv[]) @@ -75,7 +77,7 @@ int main(int argc, const char* argv[]) int major_version, minor_version; const char *driver; const char *display = getenv("DISPLAY"); - const char *name = rindex(argv[0], '/'); + const char *name = strrchr(argv[0], '/'); VAProfile profile; VAEntrypoint entrypoint, entrypoints[10]; int num_entrypoint;