diff options
author | phintuka <phintuka> | 2009-06-01 14:01:28 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2009-06-01 14:01:28 +0000 |
commit | 01115bb63b8b2d6a686c4b30a1f16d80a0992c78 (patch) | |
tree | f063efa5e9ad181bb7ea30ec241886218f53366f | |
parent | 24af9db0b50fe72d3250e675266c23b373134533 (diff) | |
download | xineliboutput-01115bb63b8b2d6a686c4b30a1f16d80a0992c78.tar.gz xineliboutput-01115bb63b8b2d6a686c4b30a1f16d80a0992c78.tar.bz2 |
Eliminated warning
(dereferencing type-punned pointer will break strict-aliasing rules)
-rw-r--r-- | frontend_local.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/frontend_local.c b/frontend_local.c index e46d6b88..6a4006c4 100644 --- a/frontend_local.c +++ b/frontend_local.c @@ -4,10 +4,12 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.c,v 1.40 2009-05-31 16:51:26 phintuka Exp $ + * $Id: frontend_local.c,v 1.41 2009-06-01 14:01:28 phintuka Exp $ * */ +#define __STDC_CONSTANT_MACROS + #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -165,17 +167,18 @@ int64_t cXinelibLocal::GetSTC() { TRACEF("cXinelibLocal::GetSTC"); - int64_t pts = -1; - char buf[32] = {0}; - strcpy(buf, "GETSTC\r\n"); + union { + char buf[32]; + int64_t pts; + } u = {"GETSTC\r\n"}; LOCK_FE; - if(fe && m_bReady) - if(0 == fe->xine_control(fe, (char*)buf)) - //if(*((int64_t *)buf) < MAX_SCR) - // if(*((int64_t *)buf) >= 0LL) - pts = *((int64_t *)buf); - return pts; + + if (fe && m_bReady) + if (0 == fe->xine_control(fe, u.buf)) + return u.pts; + + return INT64_C(-1); } // |