[xiph-commits] r8446 - in trunk/oggdsf/src:
lib/core/ogg/libOOOggSeek lib/helper/libilliCore
tools/OOOggSeekFileMaker tools/OOOggSeekFileReader
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Thu Dec 16 05:51:01 PST 2004
Author: illiminable
Date: 2004-12-16 05:51:01 -0800 (Thu, 16 Dec 2004)
New Revision: 8446
Modified:
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp
trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h
trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp
trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h
Log:
Portability fixes
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -1,5 +1,5 @@
#include "StdAfx.h"
-#include ".\autoanxseektable.h"
+#include "autoanxseektable.h"
AutoAnxSeekTable::AutoAnxSeekTable(string inFileName)
: AutoOggSeekTable(inFileName)
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -156,8 +156,8 @@
} else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\001video\000\000\000", 9)) == 0) {
//FFDSHOW
- __int64 locTimePerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 17);
- __int64 locSamplesPerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 25);
+ LOOG_INT64 locTimePerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 17);
+ LOOG_INT64 locSamplesPerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 25);
mSampleRate = (10000000 / locTimePerBlock) * locSamplesPerBlock;
mFoundStreamInfo = true;
@@ -191,7 +191,7 @@
mLastIsSeekable = true;
if (isTheora) {
- unsigned long locMod = (unsigned long)pow(2, mGranulePosShift);
+ unsigned long locMod = (unsigned long)pow((double) 2, (double) mGranulePosShift);
unsigned long locInterFrameNo = ((inOggPage->header()->GranulePos()) % locMod);
//if (locInterFrameNo == 0) {
@@ -242,7 +242,7 @@
}
}
-__int64 AutoOggSeekTable::fileDuration() {
+LOOG_INT64 AutoOggSeekTable::fileDuration() {
return mFileDuration;
}
bool AutoOggSeekTable::buildTable() {
@@ -269,4 +269,4 @@
}
return true;
-}
\ No newline at end of file
+}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -48,15 +48,15 @@
AutoOggSeekTable(string inFileName);
virtual ~AutoOggSeekTable(void);
- static const __int64 DS_UNITS = 10000000;
- static const LINT_MAX = 4294967295;
+ static const LOOG_INT64 DS_UNITS = 10000000;
+ static const unsigned long LINT_MAX = 4294967295UL;
virtual bool buildTable();
//IOggCallback interface
virtual bool acceptOggPage(OggPage* inOggPage);
- __int64 fileDuration();
+ LOOG_INT64 fileDuration();
unsigned long serialisedSize();
bool serialiseInto(unsigned char* inBuff, unsigned long inBuffSize);
@@ -74,8 +74,8 @@
bool isFLAC;
bool isOggFLAC_1_0;
bool mFoundStreamInfo;
- __int64 mLastSeekTime;
- __int64 mFileDuration;
+ LOOG_INT64 mLastSeekTime;
+ LOOG_INT64 mFileDuration;
fstream mFile;
string mFileName;
//Changed for debugging to *
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -1,5 +1,5 @@
#include "StdAfx.h"
-#include ".\oggsrecogniser.h"
+#include "oggsrecogniser.h"
OGGSRecogniser::OGGSRecogniser(void)
: mState(OGGSRecogniser::STATE_START)
@@ -57,4 +57,4 @@
}
void OGGSRecogniser::resetState() {
mState = STATE_START;
-}
\ No newline at end of file
+}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -1,5 +1,5 @@
#include "StdAfx.h"
-#include ".\oggbinaryseeker.h"
+#include "oggbinaryseeker.h"
OggBinarySeeker::OggBinarySeeker(void)
{
@@ -9,8 +9,8 @@
{
}
-OggSeekTable::tSeekPair OggBinarySeeker::getStartPos(__int64 inTime) {
+OggSeekTable::tSeekPair OggBinarySeeker::getStartPos(LOOG_INT64 inTime) {
-}
\ No newline at end of file
+}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -8,5 +8,5 @@
OggBinarySeeker(void);
virtual ~OggBinarySeeker(void);
- tSeekPair getStartPos(__int64 inTime);
+ tSeekPair getStartPos(LOOG_INT64 inTime);
};
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -31,13 +31,15 @@
#pragma once
+#include "libillicore.h"
+
class OggSeekPoint
{
public:
OggSeekPoint(void);
~OggSeekPoint(void);
- __int64 mTime;
+ LOOG_INT64 mTime;
unsigned long mStartPos;
protected:
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -49,7 +49,7 @@
bool OggSeekTable::enabled() {
return mEnabled;
}
-bool OggSeekTable::addSeekPoint(__int64 inTime, unsigned long mStartPos) {
+bool OggSeekTable::addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos) {
//stDebug<< "Add Point : Time = "<<inTime<<" -- Byte Pos : "<<mStartPos<<endl;
mSeekMap.insert(tSeekMap::value_type(inTime, mStartPos));
@@ -57,12 +57,12 @@
}
-__int64 OggSeekTable::getRealStartPos() {
+LOOG_INT64 OggSeekTable::getRealStartPos() {
return mRealStartPos;
}
-OggSeekTable::tSeekPair OggSeekTable::getStartPos(__int64 inTime) {
+OggSeekTable::tSeekPair OggSeekTable::getStartPos(LOOG_INT64 inTime) {
return *(mSeekMap.lower_bound(inTime));
//mRealStartPos = locValue.first;
//stDebug<<"Get Point : Time Req = "<<inTime<<" -- Time Given = "<<mRealStartPos<<" -- Byte Pos : "<<locValue.second<<endl;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -30,6 +30,7 @@
//===========================================================================
#pragma once
+#include "libillicore.h"
#include "libOOOggSeek.h"
#include <fstream>
#include <map>
@@ -41,20 +42,20 @@
OggSeekTable(void);
virtual ~OggSeekTable(void);
- typedef pair<__int64, unsigned long> tSeekPair;
+ typedef pair<LOOG_INT64, unsigned long> tSeekPair;
- bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
- tSeekPair getStartPos(__int64 inTime);
- __int64 getRealStartPos();
+ bool addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos);
+ tSeekPair getStartPos(LOOG_INT64 inTime);
+ LOOG_INT64 getRealStartPos();
bool enabled();
protected:
- typedef map<__int64, unsigned long> tSeekMap;
+ typedef map<LOOG_INT64, unsigned long> tSeekMap;
tSeekMap mSeekMap;
tSeekMap::value_type mSeekValue;
- __int64 mRealStartPos;
+ LOOG_INT64 mRealStartPos;
//fstream stDebug;
bool mEnabled;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -35,10 +35,13 @@
// that uses this DLL. This way any other project whose source files include this file see
// LIBOOOGGSEEK_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
-#ifdef LIBOOOGGSEEK_EXPORTS
-#define LIBOOOGGSEEK_API __declspec(dllexport)
+#ifdef WIN32
+# ifdef LIBOOOGGSEEK_EXPORTS
+# define LIBOOOGGSEEK_API __declspec(dllexport)
+# else
+# define LIBOOOGGSEEK_API __declspec(dllimport)
+# endif
#else
-#define LIBOOOGGSEEK_API __declspec(dllimport)
+# define LIBOOOGGSEEK_API
#endif
-
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -37,7 +37,7 @@
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-// TODO: reference additional headers your program requires here
+#ifdef WIN32
+# include <windows.h>
+#endif
Modified: trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -2,10 +2,23 @@
#ifdef WIN32
# include <windows.h>
-# define LOOG_INT64 signed __int64
-# define LOOG_UINT64 unsigned __int64
#else /* assume POSIX */
# include <stdint.h>
-# define LOOG_INT64 int64_t
-# define LOOG_UINT64 uint64_t
#endif
+
+#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/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -39,7 +39,11 @@
#include <iostream>
#include <fstream>
+#ifdef WIN32
int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
{
Modified: trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -7,6 +7,7 @@
#include <iostream>
-#include <tchar.h>
-// TODO: reference additional headers your program requires here
+#ifdef WIN32
+# include <tchar.h>
+#endif
Modified: trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp 2004-12-16 13:51:01 UTC (rev 8446)
@@ -9,7 +9,11 @@
#include <fstream>
using namespace std;
+#ifdef WIN32
int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
{
if (argc < 2) {
Modified: trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h 2004-12-16 13:46:20 UTC (rev 8445)
+++ trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
@@ -7,6 +7,7 @@
#include <iostream>
-#include <tchar.h>
-// TODO: reference additional headers your program requires here
+#ifdef WIN32
+# include <tchar.h>
+#endif
More information about the commits
mailing list