[xiph-commits] r8438 - in trunk/oggdsf/src: lib/core/ogg/libOOOgg lib/helper/libilliCore tools/OOOggDump tools/OOOggValidate

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Thu Dec 16 04:03:03 PST 2004


Author: illiminable
Date: 2004-12-16 04:03:03 -0800 (Thu, 16 Dec 2004)
New Revision: 8438

Modified:
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h
   trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp
   trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
   trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.h
   trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp
   trunk/oggdsf/src/tools/OOOggDump/stdafx.h
   trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp
   trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp
   trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h
   trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp
   trunk/oggdsf/src/tools/OOOggValidate/stdafx.h
Log:
Portability fixes



Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -101,14 +101,14 @@
 	return convertTime(frontTime());
 }
 
-LOOG_INT64 OggMuxStream::convertTime(__int64 inGranulePos) {
+LOOG_INT64 OggMuxStream::convertTime(LOOG_INT64 inGranulePos) {
 	LOOG_INT64 retTime = INT64_MAX;
 	if (inGranulePos != INT64_MAX) {
 		if (mIsSensibleTime) {
 			retTime = (inGranulePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
 		} else {
 			//Timestamp hacks start here...
-			unsigned long locMod = (unsigned long)pow(2, mConvTheoraLogKeyFrameInterval);
+			unsigned long locMod = (unsigned long)pow((double) 2, (double) mConvTheoraLogKeyFrameInterval);
 			
 			unsigned long locInterFrameNo = (inGranulePos) % locMod;
 	

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -44,7 +44,7 @@
 	OggMuxStream(INotifyArrival* inNotifier);
 	virtual ~OggMuxStream(void);
 	
-	static const LOOG_INT64 INT64_MAX = 9223372036854775807;
+	static const LOOG_INT64 INT64_MAX = 9223372036854775807LL;
 
 	//IOggCallback implementaion.
 	virtual bool acceptOggPage(OggPage* inOggPage);
@@ -66,7 +66,7 @@
 	virtual bool isActive();
 	virtual void setIsActive(bool inIsActive);
 
-	virtual bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor, __int64 inTheoraLogKFI);
+	virtual bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor, LOOG_INT64 inTheoraLogKFI);
 	bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor);
 
 
@@ -75,7 +75,7 @@
 	
 protected:
 	INotifyArrival* mNotifier;
-	LOOG_INT64 convertTime(__int64 inGranulePos);
+	LOOG_INT64 convertTime(LOOG_INT64 inGranulePos);
 
 	bool mIsEOS;
 	bool mIsActive;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -338,7 +338,7 @@
 	} else {
 		//Modify the header packet to include the gran pos of previous page.
 		if (mPrevGranPos != -1) {
-			inPacket->setTimeStamp(mPrevGranPos, mCurrentGranPos, StampedOggPacket::eStampType::OGG_BOTH);
+			inPacket->setTimeStamp(mPrevGranPos, mCurrentGranPos, StampedOggPacket::OGG_BOTH);
 		}
 		//Dispatch it.
 		return mPacketSink->acceptStampedOggPacket(inPacket);
@@ -350,4 +350,4 @@
 }
 unsigned long OggPacketiser::numIgnorePackets() {
 	return mNumIgnorePackets;
-}
\ No newline at end of file
+}

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -34,7 +34,7 @@
 
 StampedOggPacket::StampedOggPacket(void)
 	//:	OggPacket()
-	:	mStampType(eStampType::NONE)
+	:	mStampType(NONE)
 	,	mStartTime(0)
 	,	mEndTime(0)
 
@@ -45,7 +45,7 @@
 {
 }
 
-StampedOggPacket::StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime = 0, __int64 inEndTime = 0, unsigned short inStampType = 0)
+StampedOggPacket::StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime = 0, LOOG_INT64 inEndTime = 0, unsigned short inStampType = 0)
 	:	OggPacket(inPackData, inPacketSize, inIsTruncated, inIsContinuation)
 	,	mStartTime(inStartTime)
 	,	mEndTime(inEndTime)

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -30,6 +30,7 @@
 //===========================================================================
 
 #pragma once
+#include "stdafx.h"
 #include "oggpacket.h"
 
 class LIBOOOGG_API StampedOggPacket 
@@ -38,7 +39,7 @@
 public:
 	//Constructors
 	StampedOggPacket(void);
-	StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime, __int64 inEndTime, unsigned short inStampType);
+	StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, unsigned short inStampType);
 	virtual ~StampedOggPacket(void);
 	virtual OggPacket* clone();
 

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -35,17 +35,33 @@
 // that uses this DLL. This way any other project whose source files include this file see 
 // LIBOOOGG_API functions as being imported from a DLL, whereas this DLL sees symbols
 // defined with this macro as being exported.
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
+#pragma once
+
+#ifdef WIN32
+# ifdef LIBOOOGG_EXPORTS
+#  define LIBOOOGG_API __declspec(dllexport)
+# else
+#  define LIBOOOGG_API __declspec(dllimport)
+# endif
+# include <windows.h>
+#else  /* assume POSIX */
+# define LIBOOOGG_API
+# include <stdint.h>
 #endif
 
-#ifdef WIN32
-#include <windows.h>
-# define LOOG_INT64 signed __int64
-# define LOOG_UINT64 unsigned __int64
-#else
-# define LOOG_INT64 int64_t
-# define LOOG_UINT64 uint64_t
-#endif
\ No newline at end of file
+#ifndef LOOG_INT64
+# ifdef WIN32
+#  define LOOG_INT64 signed __int64
+# else  /* assume POSIX */
+#  define LOOG_INT64 int64_t
+# endif
+#endif
+
+#ifndef LOOG_UINT64
+# ifdef WIN32
+#  define LOOG_UINT64 unsigned __int64
+# else  /* assume POSIX */
+#  define LOOG_UINT64 uint64_t
+# endif
+#endif
+

Modified: trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -30,7 +30,7 @@
 //===========================================================================
 
 #include "StdAfx.h"
-#include ".\stringhelper.h"
+#include "stringhelper.h"
 
 StringHelper::StringHelper(void)
 {

Modified: trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -1,10 +1,11 @@
 #pragma once
 
 #ifdef WIN32
-#include <windows.h>
+# include <windows.h>
 # define LOOG_INT64 signed __int64
 # define LOOG_UINT64 unsigned __int64
-#else
+#else  /* assume POSIX */
+# include <stdint.h>
 # define LOOG_INT64 int64_t
 # define LOOG_UINT64 uint64_t
-#endif
\ No newline at end of file
+#endif

Modified: trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -0,0 +1,21 @@
+#ifdef WIN32
+# include <windows.h>
+#else  /* assume POSIX */
+# include <stdint.h>
+#endif
+
+#ifndef LOOG_INT64
+# ifdef WIN32
+#  define LOOG_INT64 signed __int64
+# else
+#  define LOOG_INT64 int64_t
+# endif
+#endif
+
+#ifndef LOOG_UINT64
+# ifdef WIN32
+#  define LOOG_INT64 signed __int64
+# else  /* assume POSIX */
+#  define LOOG_UINT64 uint64_t
+# endif
+#endif

Modified: trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -67,7 +67,11 @@
 }
 
 
+#ifdef WIN32
 int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main (int argc, char * argv[])
+#endif
 {
 	//This program just dumps the pages out of a file in ogg format.
 	// Currently does not error checking. Check your command line carefully !

Modified: trunk/oggdsf/src/tools/OOOggDump/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggDump/stdafx.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggDump/stdafx.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -38,6 +38,9 @@
 
 #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
 #include <stdio.h>
-#include <tchar.h>
 
+#ifdef WIN32
+# include <tchar.h>
+#endif
+
 // TODO: reference additional headers your program requires here

Modified: trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -10,8 +10,11 @@
 
 
 
-
+#ifdef WIN32
 int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
 {
 		//This program just dumps the pages out of a file in ogg format.
 	// Currently does not error checking. Check your command line carefully !

Modified: trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -1,5 +1,5 @@
 #include "StdAfx.h"
-#include ".\oggstreamvalidationstate.h"
+#include "oggstreamvalidationstate.h"
 
 OggStreamValidationState::OggStreamValidationState(void)
 	:	mSerialNo(0)

Modified: trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <libilliCore.h>
+
 class OggStreamValidationState
 {
 public:
@@ -17,7 +19,7 @@
 
 	};
 	unsigned long mSerialNo;
-	__int64 mGranulePosUpto;
+	LOOG_INT64 mGranulePosUpto;
 	unsigned long mSequenceNoUpto;
 
 	bool mSeenAnything;

Modified: trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp	2004-12-16 12:03:03 UTC (rev 8438)
@@ -1,5 +1,5 @@
 #include "StdAfx.h"
-#include ".\oggvalidationstate.h"
+#include "oggvalidationstate.h"
 
 OggValidationState::OggValidationState(void)
 	:	mNumBOS(0)

Modified: trunk/oggdsf/src/tools/OOOggValidate/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/stdafx.h	2004-12-16 12:01:01 UTC (rev 8437)
+++ trunk/oggdsf/src/tools/OOOggValidate/stdafx.h	2004-12-16 12:03:03 UTC (rev 8438)
@@ -7,6 +7,9 @@
 
 
 #include <iostream>
-#include <tchar.h>
 
+#ifdef WIN32
+# include <tchar.h>
+#endif
+
 // TODO: reference additional headers your program requires here



More information about the commits mailing list