From a94008b6afb1a3907740b363606fb8467bbcd79c Mon Sep 17 00:00:00 2001 From: hyc Date: Sat, 13 Mar 2010 00:31:24 +0000 Subject: [PATCH] Namespace cleanup git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@336 400ebc74-4327-4243-bc38-086b20814532 --- librtmp/amf.c | 8 ++++---- librtmp/amf.h | 10 +--------- librtmp/hashswf.c | 2 +- librtmp/parseurl.c | 2 +- librtmp/rtmp.c | 2 +- librtmp/rtmp.h | 27 +-------------------------- rtmpdump.c | 2 +- rtmpgw.c | 2 +- rtmpsrv.c | 2 +- rtmpsuck.c | 2 +- 10 files changed, 13 insertions(+), 46 deletions(-) diff --git a/librtmp/amf.c b/librtmp/amf.c index 8e22866..bd372b4 100644 --- a/librtmp/amf.c +++ b/librtmp/amf.c @@ -329,7 +329,7 @@ AMFProp_GetNumber(AMFObjectProperty * prop) return prop->p_vu.p_number; } -int +bool AMFProp_GetBoolean(AMFObjectProperty * prop) { return prop->p_vu.p_number != 0; @@ -347,7 +347,7 @@ AMFProp_GetObject(AMFObjectProperty * prop, AMFObject * obj) *obj = prop->p_vu.p_object; } -int +bool AMFProp_IsValid(AMFObjectProperty * prop) { return prop->p_type != AMF_INVALID; @@ -476,7 +476,7 @@ AMF3ReadString(const char *data, AVal * str) int AMF3Prop_Decode(AMFObjectProperty * prop, const char *pBuffer, int nSize, - int bDecodeName) + bool bDecodeName) { int nOriginalSize = nSize; AMF3DataType type; @@ -593,7 +593,7 @@ AMF3Prop_Decode(AMFObjectProperty * prop, const char *pBuffer, int nSize, int AMFProp_Decode(AMFObjectProperty * prop, const char *pBuffer, int nSize, - int bDecodeName) + bool bDecodeName) { int nOriginalSize = nSize; diff --git a/librtmp/amf.h b/librtmp/amf.h index 59e6345..a03774f 100644 --- a/librtmp/amf.h +++ b/librtmp/amf.h @@ -25,6 +25,7 @@ */ #include +#include #ifdef __cplusplus extern "C" @@ -56,15 +57,6 @@ extern "C" #define AVC(str) {str,sizeof(str)-1} #define AVMATCH(a1,a2) ((a1)->av_len == (a2)->av_len && !memcmp((a1)->av_val,(a2)->av_val,(a1)->av_len)) -#ifndef __cplusplus -#undef bool -#undef true -#undef false -#define bool int -#define true 1 -#define false 0 -#endif - struct AMFObjectProperty; typedef struct AMFObject diff --git a/librtmp/hashswf.c b/librtmp/hashswf.c index a37800d..8acba2d 100644 --- a/librtmp/hashswf.c +++ b/librtmp/hashswf.c @@ -24,7 +24,7 @@ #include #include -#include "rtmp.h" +#include "rtmp_sys.h" #include "log.h" #include "http.h" diff --git a/librtmp/parseurl.c b/librtmp/parseurl.c index 98d722b..592ae07 100644 --- a/librtmp/parseurl.c +++ b/librtmp/parseurl.c @@ -26,7 +26,7 @@ #include #include -#include "rtmp.h" +#include "rtmp_sys.h" #include "log.h" bool RTMP_ParseURL(const char *url, int *protocol, char **host, unsigned int *port, diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index 97d6011..ade7d13 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -27,7 +27,7 @@ #include #include -#include "rtmp.h" +#include "rtmp_sys.h" #include "log.h" #include diff --git a/librtmp/rtmp.h b/librtmp/rtmp.h index ba0cd29..a248259 100644 --- a/librtmp/rtmp.h +++ b/librtmp/rtmp.h @@ -26,31 +26,6 @@ #define CRYPTO -#ifdef WIN32 -#include -#define GetSockError() WSAGetLastError() -#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e) -#define EWOULDBLOCK WSAETIMEDOUT /* we don't use nonblocking, but we do use timeouts */ -#define sleep(n) Sleep(n*1000) -#define msleep(n) Sleep(n) -#define socklen_t int -#define SET_RCVTIMEO(tv,s) int tv = s*1000 -#else -#include -#include -#include -#include -#include -#include -#include -#include -#define GetSockError() errno -#undef closesocket -#define closesocket(s) close(s) -#define msleep(n) usleep(n*1000) -#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0} -#endif - #include #include @@ -304,7 +279,7 @@ extern "C" bool RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name, AMFObjectProperty * p); - bool RTMPSockBuf_Fill(RTMPSockBuf *sb); + int RTMPSockBuf_Fill(RTMPSockBuf *sb); int RTMPSockBuf_Send(RTMPSockBuf *sb, const char *buf, int len); int RTMPSockBuf_Close(RTMPSockBuf *sb); diff --git a/rtmpdump.c b/rtmpdump.c index f850b30..b2d8fac 100644 --- a/rtmpdump.c +++ b/rtmpdump.c @@ -29,7 +29,7 @@ #include // to catch Ctrl-C #include -#include "librtmp/rtmp.h" +#include "librtmp/rtmp_sys.h" #include "librtmp/log.h" #ifdef WIN32 diff --git a/rtmpgw.c b/rtmpgw.c index 3b71d11..1e9559f 100644 --- a/rtmpgw.c +++ b/rtmpgw.c @@ -28,7 +28,7 @@ #include -#include "librtmp/rtmp.h" +#include "librtmp/rtmp_sys.h" #include "librtmp/log.h" #include "thread.h" diff --git a/rtmpsrv.c b/rtmpsrv.c index d1c3a48..de96bea 100644 --- a/rtmpsrv.c +++ b/rtmpsrv.c @@ -33,7 +33,7 @@ #include -#include "librtmp/rtmp.h" +#include "librtmp/rtmp_sys.h" #include "librtmp/log.h" #include "thread.h" diff --git a/rtmpsuck.c b/rtmpsuck.c index c9ff202..219d070 100644 --- a/rtmpsuck.c +++ b/rtmpsuck.c @@ -33,7 +33,7 @@ #include -#include "librtmp/rtmp.h" +#include "librtmp/rtmp_sys.h" #include "librtmp/log.h" #include "thread.h" -- 2.40.0