# HG changeset patch
# User koda
# Date 1390340586 -3600
# Node ID de822cd3df3a380e0634ae1ee2126edcf4488a7d
# Parent 4feced261c68eaeb722eb16918a50a2104e3fef8
fixwhitespace and dos2unix
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/campaign.cpp
--- a/QTfrontend/campaign.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/campaign.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -26,31 +26,31 @@
QList getCampMissionList(QString & campaignName, QString & teamName)
{
QList missionInfoList;
- QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + teamName + ".hwt", QSettings::IniFormat, 0);
+ QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + teamName + ".hwt", QSettings::IniFormat, 0);
teamfile.setIniCodec("UTF-8");
-
+
// if entry not found check if there is written without _
// if then is found rename it to use _
QString spaceCampName = campaignName;
spaceCampName = spaceCampName.replace(QString("_"),QString(" "));
- if (!teamfile.childGroups().contains("Campaign " + campaignName) and
- teamfile.childGroups().contains("Campaign " + spaceCampName)){
- teamfile.beginGroup("Campaign " + spaceCampName);
- QStringList keys = teamfile.childKeys();
- teamfile.endGroup();
- for (int i=0;i=0 and unlockedMissions==0)
{
- for(unsigned int i=progress+1;i>0;i--)
- {
- MissionInfo missionInfo;
- missionInfo.name = campfile.value(QString("Mission %1/Name").arg(i)).toString();
- QString script = campfile.value(QString("Mission %1/Script").arg(i)).toString();
+ for(unsigned int i=progress+1;i>0;i--)
+ {
+ MissionInfo missionInfo;
+ missionInfo.name = campfile.value(QString("Mission %1/Name").arg(i)).toString();
+ QString script = campfile.value(QString("Mission %1/Script").arg(i)).toString();
missionInfo.script = script;
- missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
+ missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
QObject::tr("No description available")).toString();
QString image = campfile.value(QString("Mission %1/Script").arg(i)).toString().replace(QString(".lua"),QString(".png"));
missionInfo.image = ":/res/campaign/"+campaignName+"/"+image;
if (!QFile::exists(missionInfo.image))
- missionInfo.image = ":/res/CampaignDefault.png";
- missionInfoList.append(missionInfo);
- }
- }
- else if(unlockedMissions>0)
- {
- for(int i=1;i<=unlockedMissions;i++)
- {
- QString missionNum = QString("%1").arg(i);
- int missionNumber = teamfile.value("Campaign " + campaignName + "/Mission"+missionNum, -1).toInt();
- MissionInfo missionInfo;
- missionInfo.name = campfile.value(QString("Mission %1/Name").arg(missionNumber)).toString();
- QString script = campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString();
+ missionInfo.image = ":/res/CampaignDefault.png";
+ missionInfoList.append(missionInfo);
+ }
+ }
+ else if(unlockedMissions>0)
+ {
+ for(int i=1;i<=unlockedMissions;i++)
+ {
+ QString missionNum = QString("%1").arg(i);
+ int missionNumber = teamfile.value("Campaign " + campaignName + "/Mission"+missionNum, -1).toInt();
+ MissionInfo missionInfo;
+ missionInfo.name = campfile.value(QString("Mission %1/Name").arg(missionNumber)).toString();
+ QString script = campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString();
missionInfo.script = script;
- missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
+ missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
QObject::tr("No description available")).toString();
QString image = campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString().replace(QString(".lua"),QString(".png"));
missionInfo.image = ":/res/campaign/"+campaignName+"/"+image;
if (!QFile::exists(missionInfo.image))
- missionInfo.image = ":/res/CampaignDefault.png";
- missionInfoList.append(missionInfo);
- }
- }
- return missionInfoList;
+ missionInfo.image = ":/res/CampaignDefault.png";
+ missionInfoList.append(missionInfo);
+ }
+ }
+ return missionInfoList;
}
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/campaign.h
--- a/QTfrontend/campaign.h Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/campaign.h Tue Jan 21 22:43:06 2014 +0100
@@ -23,11 +23,11 @@
class MissionInfo
{
- public:
- QString name;
- QString description;
- QString script;
- QString image;
+ public:
+ QString name;
+ QString description;
+ QString script;
+ QString image;
};
QList getCampMissionList(QString & campaignName, QString & teamName);
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/hwform.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -1903,15 +1903,15 @@
Q_UNUSED(index);
HWTeam team(ui.pageCampaign->CBTeam->currentText());
QString campaignName = ui.pageCampaign->CBCampaign->currentText().replace(QString(" "),QString("_"));
- QString tName = team.name();
-
- campaignMissionInfo = getCampMissionList(campaignName,tName);
- ui.pageCampaign->CBMission->clear();
-
+ QString tName = team.name();
+
+ campaignMissionInfo = getCampMissionList(campaignName,tName);
+ ui.pageCampaign->CBMission->clear();
+
for(int i=0;iCBMission->addItem(QString(campaignMissionInfo[i].name), QString(campaignMissionInfo[i].name));
- }
+ }
}
void HWForm::UpdateCampaignPageMission(int index)
@@ -1923,7 +1923,7 @@
if(index > -1 && index < campaignMissionInfo.count()) {
ui.pageCampaign->lbltitle->setText(""+ui.pageCampaign->CBMission->currentText()+"
");
ui.pageCampaign->lbldescription->setText(campaignMissionInfo[index].description);
- ui.pageCampaign->btnPreview->setIcon(QIcon(campaignMissionInfo[index].image));
+ ui.pageCampaign->btnPreview->setIcon(QIcon(campaignMissionInfo[index].image));
}
}
@@ -1935,12 +1935,12 @@
UpdateCampaignPage(0);
for(int i=0;iCBMission->count();i++)
{
- if (ui.pageCampaign->CBMission->itemText(i)==missionTitle)
- {
- ui.pageCampaign->CBMission->setCurrentIndex(i);
- break;
- }
- }
+ if (ui.pageCampaign->CBMission->itemText(i)==missionTitle)
+ {
+ ui.pageCampaign->CBMission->setCurrentIndex(i);
+ break;
+ }
+ }
}
// used for --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/hwform.h
--- a/QTfrontend/hwform.h Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/hwform.h Tue Jan 21 22:43:06 2014 +0100
@@ -196,7 +196,7 @@
AmmoSchemeModel * ammoSchemeModel;
QStack PagesStack;
QString previousCampaignName;
- QString previousTeamName;
+ QString previousTeamName;
QList campaignMissionInfo;
QTime eggTimer;
BGWidget * wBackground;
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/ui/page/pagegamestats.cpp
--- a/QTfrontend/ui/page/pagegamestats.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/ui/page/pagegamestats.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -40,13 +40,13 @@
QLayout * PageGameStats::bodyLayoutDefinition()
{
- kindOfPoints = QString("");
- defaultGraphTitle = true;
+ kindOfPoints = QString("");
+ defaultGraphTitle = true;
QGridLayout * pageLayout = new QGridLayout();
pageLayout->setSpacing(20);
pageLayout->setColumnStretch(0, 1);
pageLayout->setColumnStretch(1, 1);
- pageLayout->setRowStretch(0, 1);
+ pageLayout->setRowStretch(0, 1);
pageLayout->setRowStretch(1, 20);
//pageLayout->setRowStretch(1, -1); this should work but there is unnecessary empty space betwin lines if used
pageLayout->setContentsMargins(7, 7, 7, 0);
@@ -106,11 +106,11 @@
QLayout * PageGameStats::footerLayoutDefinition()
{
QHBoxLayout * bottomLayout = new QHBoxLayout();
-
+
mainNote = new QLabel(this);
mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
mainNote->setWordWrap(true);
-
+
bottomLayout->addWidget(mainNote, 0);
bottomLayout->setStretch(0,1);
@@ -159,41 +159,41 @@
void PageGameStats::renderStats()
{
- graphic->show();
- labelGraphTitle-> show();
- if(defaultGraphTitle) {
- labelGraphTitle->setText("
" + PageGameStats::tr("Health graph") + "
");
- } else {
- defaultGraphTitle = true;
- }
- // if not health data sent
- if(healthPoints.size() == 0) {
- labelGraphTitle->hide();
- graphic->hide();
- } else {
- QGraphicsScene * scene = new QGraphicsScene();
+ graphic->show();
+ labelGraphTitle-> show();
+ if(defaultGraphTitle) {
+ labelGraphTitle->setText("
" + PageGameStats::tr("Health graph") + "
");
+ } else {
+ defaultGraphTitle = true;
+ }
+ // if not health data sent
+ if(healthPoints.size() == 0) {
+ labelGraphTitle->hide();
+ graphic->hide();
+ } else {
+ QGraphicsScene * scene = new QGraphicsScene();
- QMap >::const_iterator i = healthPoints.constBegin();
- while (i != healthPoints.constEnd())
- {
- quint32 c = i.key();
- //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
- QVector hps = i.value();
+ QMap >::const_iterator i = healthPoints.constBegin();
+ while (i != healthPoints.constEnd())
+ {
+ quint32 c = i.key();
+ //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
+ QVector hps = i.value();
- QPainterPath path;
- if (hps.size())
- path.moveTo(0, hps[0]);
+ QPainterPath path;
+ if (hps.size())
+ path.moveTo(0, hps[0]);
- for(int t = 1; t < hps.size(); ++t)
- path.lineTo(t, hps[t]);
+ for(int t = 1; t < hps.size(); ++t)
+ path.lineTo(t, hps[t]);
- scene->addPath(path, QPen(c));
- ++i;
- }
+ scene->addPath(path, QPen(c));
+ ++i;
+ }
- graphic->setScene(scene);
- graphic->fitInView(graphic->sceneRect());
- }
+ graphic->setScene(scene);
+ graphic->fitInView(graphic->sceneRect());
+ }
}
void PageGameStats::GameStats(char type, const QString & info)
@@ -237,9 +237,9 @@
}
case 'g' :
{
- // TODO: change default picture or add change pic capability
- defaultGraphTitle = false;
- labelGraphTitle->setText("
" + info + "
");
+ // TODO: change default picture or add change pic capability
+ defaultGraphTitle = false;
+ labelGraphTitle->setText("
" + info + "
");
break;
}
case 'T': // local team stats
@@ -257,7 +257,7 @@
}
break;
}
- case 'p' :
+ case 'p' :
{
kindOfPoints = info;
break;
@@ -300,11 +300,11 @@
QString message;
QString killstring;
if(kindOfPoints.compare("") == 0) {
- killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
- } else {
- killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
- kindOfPoints = QString("");
- }
+ killstring = PageGameStats::tr("(%1 kill)", "", kills).arg(kills);
+ } else {
+ killstring = PageGameStats::tr("(%1 %2)", "", kills).arg(kills).arg(kindOfPoints);
+ kindOfPoints = QString("");
+ }
message = QString("%1 %2. %3 ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "
";
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/ui/page/pagemain.cpp
--- a/QTfrontend/ui/page/pagemain.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/ui/page/pagemain.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -209,7 +209,7 @@
file.close();
}
-
+
if(Tips.length())
return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()];
else
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/ui/page/pagenetserver.cpp
--- a/QTfrontend/ui/page/pagenetserver.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/ui/page/pagenetserver.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -124,7 +124,7 @@
// This function assumes that the user wants to share his server while connected to
// the Internet and that he/she is using direct access (eg no NATs). To determine the
-// IP we briefly connect to Hedgewars website and fallback to user intervention
+// IP we briefly connect to Hedgewars website and fallback to user intervention
// after 4 seconds of timeout.
void PageNetServer::copyUrl()
{
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/ui/page/pageoptions.cpp
--- a/QTfrontend/ui/page/pageoptions.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/ui/page/pageoptions.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -397,7 +397,7 @@
tagsLayout->addWidget(CBHogTag, 0);
tagsLayout->addWidget(CBHealthTag, 0);
tagsLayout->addWidget(CBTagOpacity, 0);
- tagsLayout->addStretch(1);
+ tagsLayout->addStretch(1);
}
{ // group: frontend
diff -r 4feced261c68 -r de822cd3df3a QTfrontend/util/FileEngine.h
--- a/QTfrontend/util/FileEngine.h Tue Jan 21 22:38:13 2014 +0100
+++ b/QTfrontend/util/FileEngine.h Tue Jan 21 22:43:06 2014 +0100
@@ -1,93 +1,93 @@
-#ifndef _FileEngine_h
-#define _FileEngine_h
-
-#include
-#include
-#include
-#include
-
-#include "physfs.h"
-
-
-
-class FileEngine : public QAbstractFileEngine
-{
- public:
- FileEngine(const QString& filename);
-
- virtual ~FileEngine();
-
- virtual bool open(QIODevice::OpenMode openMode);
- virtual bool close();
- virtual bool flush();
- virtual qint64 size() const;
- virtual qint64 pos() const;
- virtual bool setSize(qint64 size);
- virtual bool seek(qint64 pos);
- virtual bool isSequential() const;
- virtual bool remove();
- virtual bool mkdir(const QString &dirName, bool createParentDirectories) const;
- virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
- virtual bool caseSensitive() const;
- virtual bool isRelativePath() const;
- QAbstractFileEngineIterator *beginEntryList(QDir::Filters filters, const QStringList & filterNames);
- virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
- virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const;
- virtual QString fileName(FileName file=DefaultName) const;
- virtual QDateTime fileTime(FileTime time) const;
- virtual void setFileName(const QString &file);
- bool atEnd() const;
-
- virtual qint64 read(char *data, qint64 maxlen);
- virtual qint64 readLine(char *data, qint64 maxlen);
- virtual qint64 write(const char *data, qint64 len);
-
- bool isOpened() const;
-
- QFile::FileError error() const;
- QString errorString() const;
-
- virtual bool supportsExtension(Extension extension) const;
-
- private:
- PHYSFS_file *m_handle;
- qint64 m_size;
- FileFlags m_flags;
- QString m_fileName;
- QDateTime m_date;
- bool m_bufferSet;
- bool m_readWrite;
-};
-
-class FileEngineHandler : public QAbstractFileEngineHandler
-{
- public:
- FileEngineHandler(char * argv0);
- ~FileEngineHandler();
-
- QAbstractFileEngine *create(const QString &filename) const;
-
- static void mount(const QString & path);
- static void mount(const QString & path, const QString & mountPoint);
- static void setWriteDir(const QString & path);
- static void mountPacks();
- static QString errorStr();
-
-// private:
- static const QString scheme;
-};
-
-class FileEngineIterator : public QAbstractFileEngineIterator
-{
-public:
- FileEngineIterator(QDir::Filters filters, const QStringList & nameFilters, const QStringList & entries);
-
- bool hasNext() const;
- QString next();
- QString currentFileName() const;
-private:
- QStringList m_entries;
- int m_index;
-};
-
-#endif
+#ifndef _FileEngine_h
+#define _FileEngine_h
+
+#include
+#include
+#include
+#include
+
+#include "physfs.h"
+
+
+
+class FileEngine : public QAbstractFileEngine
+{
+ public:
+ FileEngine(const QString& filename);
+
+ virtual ~FileEngine();
+
+ virtual bool open(QIODevice::OpenMode openMode);
+ virtual bool close();
+ virtual bool flush();
+ virtual qint64 size() const;
+ virtual qint64 pos() const;
+ virtual bool setSize(qint64 size);
+ virtual bool seek(qint64 pos);
+ virtual bool isSequential() const;
+ virtual bool remove();
+ virtual bool mkdir(const QString &dirName, bool createParentDirectories) const;
+ virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
+ virtual bool caseSensitive() const;
+ virtual bool isRelativePath() const;
+ QAbstractFileEngineIterator *beginEntryList(QDir::Filters filters, const QStringList & filterNames);
+ virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
+ virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const;
+ virtual QString fileName(FileName file=DefaultName) const;
+ virtual QDateTime fileTime(FileTime time) const;
+ virtual void setFileName(const QString &file);
+ bool atEnd() const;
+
+ virtual qint64 read(char *data, qint64 maxlen);
+ virtual qint64 readLine(char *data, qint64 maxlen);
+ virtual qint64 write(const char *data, qint64 len);
+
+ bool isOpened() const;
+
+ QFile::FileError error() const;
+ QString errorString() const;
+
+ virtual bool supportsExtension(Extension extension) const;
+
+ private:
+ PHYSFS_file *m_handle;
+ qint64 m_size;
+ FileFlags m_flags;
+ QString m_fileName;
+ QDateTime m_date;
+ bool m_bufferSet;
+ bool m_readWrite;
+};
+
+class FileEngineHandler : public QAbstractFileEngineHandler
+{
+ public:
+ FileEngineHandler(char * argv0);
+ ~FileEngineHandler();
+
+ QAbstractFileEngine *create(const QString &filename) const;
+
+ static void mount(const QString & path);
+ static void mount(const QString & path, const QString & mountPoint);
+ static void setWriteDir(const QString & path);
+ static void mountPacks();
+ static QString errorStr();
+
+// private:
+ static const QString scheme;
+};
+
+class FileEngineIterator : public QAbstractFileEngineIterator
+{
+public:
+ FileEngineIterator(QDir::Filters filters, const QStringList & nameFilters, const QStringList & entries);
+
+ bool hasNext() const;
+ QString next();
+ QString currentFileName() const;
+private:
+ QStringList m_entries;
+ int m_index;
+};
+
+#endif
diff -r 4feced261c68 -r de822cd3df3a gameServer/Actions.hs
--- a/gameServer/Actions.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/Actions.hs Tue Jan 21 22:43:06 2014 +0100
@@ -327,11 +327,11 @@
thisRoomChans <- liftM (map sendChan) $ roomClientsS ri
joinedMidGame <- liftM (filter isJoinedMidGame) $ roomClientsS ri
answerRemovedTeams <- io $
- room'sM rnc (\r -> let gi = fromJust $ gameInfo r in
- concatMap (\c ->
+ room'sM rnc (\r -> let gi = fromJust $ gameInfo r in
+ concatMap (\c ->
(answerFullConfigParams c (mapParams r) (params r))
++
- (map (\t -> AnswerClients [sendChan c] ["REMOVE_TEAM", t]) $ leftTeams gi)
+ (map (\t -> AnswerClients [sendChan c] ["REMOVE_TEAM", t]) $ leftTeams gi)
) joinedMidGame
) ri
@@ -357,7 +357,7 @@
ModifyRoom (\r -> r{
gameInfo = liftM (\g -> g{
teamsInGameNumber = teamsInGameNumber g - 1
- , roundMsgs = (if isJust $ lastFilteredTimedMsg g then (:) (fromJust $ lastFilteredTimedMsg g) else id)
+ , roundMsgs = (if isJust $ lastFilteredTimedMsg g then (:) (fromJust $ lastFilteredTimedMsg g) else id)
$ rmTeamMsg : roundMsgs g
}) $ gameInfo r
})
@@ -456,11 +456,11 @@
wp <- client's webPassword
chan <- client's sendChan
mapM_ processAction $
- if wp == p then
+ if wp == p then
[ModifyClient $ \c -> c{logonPassed = True}
, AnswerClients [chan] ["LOGONPASSED"]
]
- else
+ else
[ByeClient $ loc "Authentication failed"]
playerLogin p a contr = do
chan <- client's sendChan
@@ -530,7 +530,7 @@
processAction (BanNick n seconds reason) = do
currentTime <- io getCurrentTime
- let msg =
+ let msg =
if seconds > 60 * 60 * 24 * 365 then
B.concat ["Permanent ban (", reason, ")"]
else
@@ -775,7 +775,7 @@
processAction Cleanup = do
jm <- gets joinsMonitor
-
+
io $ do
t <- getCurrentTime
cleanup jm t
diff -r 4feced261c68 -r de822cd3df3a gameServer/EngineInteraction.hs
--- a/gameServer/EngineInteraction.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/EngineInteraction.hs Tue Jan 21 22:43:06 2014 +0100
@@ -42,7 +42,7 @@
encode = B.pack . Base64.encode . BW.unpack . B.concat
isLegal m = (B.length m > 1) && (flip Set.member legalMessages . B.head . B.tail $ m)
lft = foldr l Nothing
- l m n = let m' = B.head $ B.tail m; tst = flip Set.member in
+ l m n = let m' = B.head $ B.tail m; tst = flip Set.member in
if not $ tst timedMessages m' then n
else if '+' /= m' then Just Nothing else Just . Just . B.pack . Base64.encode . BW.unpack $ m
isNonEmpty = (/=) '+' . B.head . B.tail
diff -r 4feced261c68 -r de822cd3df3a gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/HWProtoInRoomState.hs Tue Jan 21 22:43:06 2014 +0100
@@ -215,7 +215,7 @@
gs <- if (not $ isReady cl) && (isSpecial rm) && (unreadyClients == [cl]) then startGame else return []
- return $
+ return $
ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)})
: ModifyClient (\c -> c{isReady = not $ isReady cl})
: (AnswerClients chans $ if clientProto cl < 38 then
@@ -236,7 +236,7 @@
if teamsInGame cl > 0 && (isJust $ gameInfo rm) && (not $ B.null legalMsgs) then
return $ AnswerClients chans ["EM", legalMsgs]
- : [ModifyRoom (\r -> r{gameInfo = liftM
+ : [ModifyRoom (\r -> r{gameInfo = liftM
(\g -> g{
roundMsgs = if B.null nonEmptyMsgs then roundMsgs g else nonEmptyMsgs : roundMsgs g
, lastFilteredTimedMsg = fromMaybe (lastFilteredTimedMsg g) lastFTMsg})
@@ -306,7 +306,7 @@
if not $ isMaster cl then
[ProtocolError $ loc "Not room master"]
else
- if illegalName newName then
+ if illegalName newName then
[Warning $ loc "Illegal room name"]
else
if isSpecial rm then
diff -r 4feced261c68 -r de822cd3df3a gameServer/OfficialServer/checker.hs
--- a/gameServer/OfficialServer/checker.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/OfficialServer/checker.hs Tue Jan 21 22:43:06 2014 +0100
@@ -28,7 +28,7 @@
readInt_ str =
case B.readInt str of
Just (i, t) | B.null t -> fromIntegral i
- _ -> 0
+ _ -> 0
data Message = Packet [B.ByteString]
| CheckFailed B.ByteString
diff -r 4feced261c68 -r de822cd3df3a gameServer/OfficialServer/extdbinterface.hs
--- a/gameServer/OfficialServer/extdbinterface.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/OfficialServer/extdbinterface.hs Tue Jan 21 22:43:06 2014 +0100
@@ -18,7 +18,7 @@
dbQueryAccount =
- "SELECT users.pass, \
+ "SELECT users.pass, \
\ (SELECT COUNT(users_roles.rid) FROM users_roles WHERE users.uid = users_roles.uid AND users_roles.rid = 3), \
\ (SELECT COUNT(users_roles.rid) FROM users_roles WHERE users.uid = users_roles.uid AND users_roles.rid = 13) \
\ FROM users WHERE users.name = ?"
@@ -71,7 +71,7 @@
SendStats clients rooms ->
run dbConn dbQueryStats [SqlInt32 $ fromIntegral clients, SqlInt32 $ fromIntegral rooms] >> return ()
--StoreAchievements (B.pack fileName) (map toPair teams) info
- StoreAchievements p fileName teams info ->
+ StoreAchievements p fileName teams info ->
mapM_ (run dbConn dbQueryAchievement) $ (parseStats p fileName teams) info
diff -r 4feced261c68 -r de822cd3df3a gameServer/ServerCore.hs
--- a/gameServer/ServerCore.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/ServerCore.hs Tue Jan 21 22:43:06 2014 +0100
@@ -62,8 +62,8 @@
TimerAction tick ->
mapM_ processAction $
- PingAll
- : [StatsAction | even tick]
+ PingAll
+ : [StatsAction | even tick]
++ [Cleanup | tick `mod` 100 == 0]
diff -r 4feced261c68 -r de822cd3df3a gameServer/Utils.hs
--- a/gameServer/Utils.hs Tue Jan 21 22:38:13 2014 +0100
+++ b/gameServer/Utils.hs Tue Jan 21 22:43:06 2014 +0100
@@ -116,7 +116,7 @@
readInt_ str =
case B.readInt str of
Just (i, t) | B.null t -> fromIntegral i
- _ -> 0
+ _ -> 0
cutHost :: B.ByteString -> B.ByteString
cutHost = B.intercalate "." . flip (++) ["*","*"] . List.take 2 . B.split '.'
@@ -128,7 +128,7 @@
upperCase = UTF8.fromString . map Char.toUpper . UTF8.toString
roomInfo :: Word16 -> B.ByteString -> RoomInfo -> [B.ByteString]
-roomInfo p n r
+roomInfo p n r
| p < 46 = [
showB $ isJust $ gameInfo r,
name r,
diff -r 4feced261c68 -r de822cd3df3a hedgewars/hwLibrary.pas
--- a/hedgewars/hwLibrary.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/hwLibrary.pas Tue Jan 21 22:43:06 2014 +0100
@@ -106,12 +106,12 @@
procedure JNI_HW_GenLandPreview(env: PJNIEnv; c: JClass; port: JInt); cdecl;
begin
- GenLandPreview(port);
+ GenLandPreview(port);
end;
exports
- JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto',
- JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion',
+ JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto',
+ JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion',
JNI_HW_GenLandPreview name Java_Prefix + 'HWGenLandPreview',
HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons',
HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs',
diff -r 4feced261c68 -r de822cd3df3a hedgewars/sdlmain/SDLMain.m
--- a/hedgewars/sdlmain/SDLMain.m Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/sdlmain/SDLMain.m Tue Jan 21 22:43:06 2014 +0100
@@ -18,21 +18,21 @@
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
-#define SDL_USE_NIB_FILE 0
+#define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */
-#define SDL_USE_CPS 1
+#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
- UInt32 lo;
- UInt32 hi;
+ UInt32 lo;
+ UInt32 hi;
} CPSProcessSerNum;
-extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
-extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
-extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
@@ -198,8 +198,8 @@
/* Replacement for NSApplicationMain */
static void CustomApplicationMain (int argc, char **argv)
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- SDLMain *sdlMain;
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
/* Ensure the application object is initialised */
[SDLApplication sharedApplication];
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uAIActions.pas
--- a/hedgewars/uAIActions.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uAIActions.pas Tue Jan 21 22:43:06 2014 +0100
@@ -45,7 +45,7 @@
aia_Put = $800A;
aia_waitAngle = $800B;
aia_waitAmmoXY = $800C;
-
+
aim_push = $8000;
aim_release = $8001;
ai_specmask = $8000;
@@ -55,7 +55,7 @@
X, Y, Param: LongInt;
Time: Longword;
end;
-
+
TActions = record
Count, Pos: Longword;
actions: array[0..Pred(MAXACTIONS)] of TAction;
@@ -109,7 +109,7 @@
WriteLnToConsole('AI action: '+SpecActionIdToStr[Action.Action]);
if (Action.Action = aia_WaitXL) or (Action.Action = aia_WaitXR) then
WriteLnToConsole('AI action Wait X = '+IntToStr(Action.Param)+', current X = '+IntToStr(hwRound(Me^.X)))
-
+
else if (Action.Action = aia_AwareExpl) then
WriteLnToConsole('Aware X = ' + IntToStr(Action.X) + ', Y = ' + IntToStr(Action.Y));
end
@@ -165,10 +165,10 @@
{$ENDIF}
if (Action and ai_specmask) <> 0 then
case Action of
- aia_Weapon:
+ aia_Weapon:
SetWeapon(TAmmoType(Param));
-
- aia_WaitXL:
+
+ aia_WaitXL:
if hwRound(Me^.X) = Param then
begin
Action:= aia_LookLeft;
@@ -182,12 +182,12 @@
exit
end
else
- begin
+ begin
CheckHang(Me);
exit
end;
-
- aia_WaitXR:
+
+ aia_WaitXR:
if hwRound(Me^.X) = Param then
begin
Action:= aia_LookRight;
@@ -201,7 +201,7 @@
exit
end
else
- begin
+ begin
CheckHang(Me);
exit
end;
@@ -222,24 +222,24 @@
else ParseCommand('-right', true);
aia_AwareExpl:
AwareOfExplosion(X, Y, Param);
-
+
aia_HJump:
ParseCommand('hjump', true);
-
+
aia_LJump:
ParseCommand('ljump', true);
-
+
aia_Skip:
ParseCommand('skip', true);
-
+
aia_Put:
doPut(X, Y, true);
-
+
aia_waitAngle:
if LongInt(Me^.Angle) <> Abs(Param) then exit;
aia_waitAmmoXY:
- if (CurAmmoGear <> nil) and ((hwRound(CurAmmoGear^.X) <> X) or (hwRound(CurAmmoGear^.Y) <> Y)) then
+ if (CurAmmoGear <> nil) and ((hwRound(CurAmmoGear^.X) <> X) or (hwRound(CurAmmoGear^.Y) <> Y)) then
exit;
end
else
@@ -249,7 +249,7 @@
case Param of
aim_push:
s:= '+' + s;
-
+
aim_release:
s:= '-' + s;
end
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uAILandMarks.pas
--- a/hedgewars/uAILandMarks.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uAILandMarks.pas Tue Jan 21 22:43:06 2014 +0100
@@ -1,7 +1,7 @@
unit uAILandMarks;
interface
-const
+const
markWalkedHere = $01;
markHJumped = $02;
markLJumped = $04;
@@ -35,13 +35,13 @@
function checkMark(X, Y: LongInt; mark: byte) : boolean;
begin
- checkMark:= ((X and LAND_WIDTH_MASK) = 0)
- and ((Y and LAND_HEIGHT_MASK) = 0)
+ checkMark:= ((X and LAND_WIDTH_MASK) = 0)
+ and ((Y and LAND_HEIGHT_MASK) = 0)
and ((marks[Y shr gr, X shr gr] and mark) <> 0)
end;
procedure clearAllMarks;
-var
+var
Y, X: Longword;
begin
for Y:= 0 to Pred(HEIGHT) do
@@ -50,7 +50,7 @@
end;
procedure clearMarks(mark: byte);
-var
+var
Y, X: Longword;
begin
for Y:= 0 to Pred(HEIGHT) do
@@ -62,7 +62,7 @@
begin
WIDTH:= LAND_WIDTH shr gr;
HEIGHT:= LAND_HEIGHT shr gr;
-
+
SetLength(marks, HEIGHT, WIDTH);
end;
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uCommands.pas
--- a/hedgewars/uCommands.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uCommands.pas Tue Jan 21 22:43:06 2014 +0100
@@ -106,7 +106,7 @@
begin
if TrustedSource or t^.Trusted then
begin
- if t^.Rand and (not CheckNoTeamOrHH) then
+ if t^.Rand and (not CheckNoTeamOrHH) then
CheckSum:= CheckSum xor LongWord(SDLNet_Read32(@CmdStr)) xor LongWord(s[0]) xor GameTicks;
t^.Handler(s);
end;
@@ -139,7 +139,7 @@
if (Message and gmLeft) <> 0 then
ParseCommand('/-left', true)
else if (Message and gmRight) <> 0 then
- ParseCommand('/-right', true)
+ ParseCommand('/-right', true)
else if (Message and gmUp) <> 0 then
ParseCommand('/-up', true)
else if (Message and gmDown) <> 0 then
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uCursor.pas
--- a/hedgewars/uCursor.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uCursor.pas Tue Jan 21 22:43:06 2014 +0100
@@ -25,7 +25,7 @@
var x, y: LongInt;
begin
SDL_GetMouseState(@x, @y);
-
+
if(x <> cScreenWidth div 2) or (y <> cScreenHeight div 2) then
begin
handlePositionUpdate(x - cScreenWidth div 2, y - cScreenHeight div 2);
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uGearsHandlersRope.pas Tue Jan 21 22:43:06 2014 +0100
@@ -29,13 +29,13 @@
uAmmos, uDebug, uUtils, uGearsHedgehog, uGearsRender;
procedure doStepRopeAfterAttack(Gear: PGear);
-var
+var
HHGear: PGear;
tX: hwFloat;
begin
HHGear := Gear^.Hedgehog^.Gear;
tX:= HHGear^.X;
- if WorldWrap(HHGear) and (WorldEdge = weWrap) and
+ if WorldWrap(HHGear) and (WorldEdge = weWrap) and
((TestCollisionXwithGear(HHGear, 1) <> 0) or (TestCollisionXwithGear(HHGear, -1) <> 0)) then
begin
HHGear^.X:= tX;
@@ -70,7 +70,7 @@
HHGear^.X := HHGear^.X + HHGear^.dX;
HHGear^.Y := HHGear^.Y + HHGear^.dY;
HHGear^.dY := HHGear^.dY + cGravity;
-
+
if (GameFlags and gfMoreWind) <> 0 then
HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density;
@@ -113,7 +113,7 @@
end;
procedure doStepRopeWork(Gear: PGear);
-var
+var
HHGear: PGear;
len, tx, ty, nx, ny, ropeDx, ropeDy, mdX, mdY: hwFloat;
lx, ly, cd: LongInt;
@@ -126,7 +126,7 @@
HHGear := Gear^.Hedgehog^.Gear;
tX:= HHGear^.X;
- if WorldWrap(HHGear) and (WorldEdge = weWrap) and
+ if WorldWrap(HHGear) and (WorldEdge = weWrap) and
((TestCollisionXwithGear(HHGear, 1) <> 0) or (TestCollisionXwithGear(HHGear, -1) <> 0)) then
begin
PlaySound(sndRopeRelease);
@@ -405,7 +405,7 @@
end;
procedure doStepRopeAttach(Gear: PGear);
-var
+var
HHGear: PGear;
tx, ty, tt: hwFloat;
begin
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uLand.pas
--- a/hedgewars/uLand.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uLand.pas Tue Jan 21 22:43:06 2014 +0100
@@ -37,7 +37,7 @@
procedure ResizeLand(width, height: LongWord);
var potW, potH: LongInt;
-begin
+begin
potW:= toPowerOf2(width);
potH:= toPowerOf2(height);
if (potW <> LAND_WIDTH) or (potH <> LAND_HEIGHT) then
@@ -120,7 +120,7 @@
// vertical
s:= LAND_HEIGHT;
-
+
for x:= 0 to LAND_WIDTH - 1 do
for y:= 0 to LAND_HEIGHT - 1 do
if Land[y, x] = 0 then
@@ -129,7 +129,7 @@
for i:= max(s, y - 8) to y - 1 do
begin
if ((x + i) and 16) = 0 then c:= c1 else c:= c2;
-
+
if (cReducedQuality and rqBlurryLand) = 0 then
LandPixels[i, x]:= c
else
@@ -144,17 +144,17 @@
if s + 8 > y then
begin
if ((x + y) and 16) = 0 then c:= c1 else c:= c2;
-
+
if (cReducedQuality and rqBlurryLand) = 0 then
LandPixels[y, x]:= c
else
LandPixels[y div 2, x div 2]:= c
- end;
+ end;
end;
-
+
// horizontal
s:= LAND_WIDTH;
-
+
for y:= 0 to LAND_HEIGHT - 1 do
for x:= 0 to LAND_WIDTH - 1 do
if Land[y, x] = 0 then
@@ -163,7 +163,7 @@
for i:= max(s, x - 8) to x - 1 do
begin
if ((y + i) and 16) = 0 then c:= c1 else c:= c2;
-
+
if (cReducedQuality and rqBlurryLand) = 0 then
LandPixels[y, i]:= c
else
@@ -178,12 +178,12 @@
if s + 8 > x then
begin
if ((x + y) and 16) = 0 then c:= c1 else c:= c2;
-
+
if (cReducedQuality and rqBlurryLand) = 0 then
LandPixels[y, x]:= c
else
LandPixels[y div 2, x div 2]:= c
- end;
+ end;
end
end;
@@ -375,7 +375,7 @@
dec(l, TemplateCounts[cTemplateFilter]);
until l < 0;
end else getRandom(1);
-
+
case cTemplateFilter of
0: OutError('Ask unC0Rr about what you did wrong', true);
1: SelectTemplate:= SmallTemplates[getrandom(TemplateCounts[cTemplateFilter])];
@@ -436,12 +436,12 @@
LandSurface2LandPixels(tmpsurf);
SDL_FreeSurface(tmpsurf);
-
+
if gameFlags and gfShoppaBorder <> 0 then DrawShoppaBorder;
-
+
for x:= leftX+2 to rightX-2 do
for y:= topY+2 to LAND_HEIGHT-3 do
- if (Land[y, x] = 0) and
+ if (Land[y, x] = 0) and
(((Land[y, x-1] = lfBasic) and ((Land[y+1,x] = lfBasic)) or (Land[y-1,x] = lfBasic)) or
((Land[y, x+1] = lfBasic) and ((Land[y-1,x] = lfBasic) or (Land[y+1,x] = lfBasic)))) then
begin
@@ -449,16 +449,16 @@
begin
if (Land[y, x-1] = lfBasic) and (LandPixels[y, x-1] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y, x-1]
-
+
else if (Land[y, x+1] = lfBasic) and (LandPixels[y, x+1] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y, x+1]
-
+
else if (Land[y-1, x] = lfBasic) and (LandPixels[y-1, x] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y-1, x]
-
+
else if (Land[y+1, x] = lfBasic) and (LandPixels[y+1, x] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y+1, x];
-
+
if (((LandPixels[y,x] and AMask) shr AShift) > 10) then
LandPixels[y,x]:= (LandPixels[y,x] and (not AMask)) or (128 shl AShift)
end;
@@ -473,25 +473,25 @@
((Land[y-1, x] = lfBasic) and (Land[y-1,x+1] = lfBasic) and (Land[y,x+2] = lfBasic)) or
((Land[y+1, x] = lfBasic) and (Land[y+1,x-1] = lfBasic) and (Land[y,x-2] = lfBasic)) or
((Land[y-1, x] = lfBasic) and (Land[y-1,x-1] = lfBasic) and (Land[y,x-2] = lfBasic))) then
-
+
begin
-
+
if (cReducedQuality and rqBlurryLand) = 0 then
-
+
begin
-
+
if (Land[y, x-1] = lfBasic) and (LandPixels[y,x-1] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y, x-1]
-
+
else if (Land[y, x+1] = lfBasic) and (LandPixels[y,x+1] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y, x+1]
-
+
else if (Land[y+1, x] = lfBasic) and (LandPixels[y+1,x] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y+1, x]
-
+
else if (Land[y-1, x] = lfBasic) and (LandPixels[y-1,x] and AMask <> 0) then
LandPixels[y, x]:= LandPixels[y-1, x];
-
+
if (((LandPixels[y,x] and AMask) shr AShift) > 10) then
LandPixels[y,x]:= (LandPixels[y,x] and (not AMask)) or (64 shl AShift)
end;
@@ -778,7 +778,7 @@
if (GameFlags and gfForts = 0) and (maskOnly or (cPathz[ptMapCurrent] = '')) then
AddObjects
-
+
else
AddProgress();
@@ -834,7 +834,7 @@
rw:= rh*2;
end;
if rh < rw div 2 then rh:= rw * 2;
-
+
ox:= (rw-LAND_WIDTH) div 2;
oy:= rh-LAND_HEIGHT;
@@ -850,7 +850,7 @@
cbit:= bit * 8;
for yy:= y * lh to y * lh + 7 do
for xx:= x * lw + cbit to x * lw + cbit + 7 do
- if ((yy-oy) and LAND_HEIGHT_MASK = 0) and ((xx-ox) and LAND_WIDTH_MASK = 0)
+ if ((yy-oy) and LAND_HEIGHT_MASK = 0) and ((xx-ox) and LAND_WIDTH_MASK = 0)
and (Land[yy-oy, xx-ox] <> 0) then
inc(t);
if t > 8 then
diff -r 4feced261c68 -r de822cd3df3a hedgewars/uTextures.pas
--- a/hedgewars/uTextures.pas Tue Jan 21 22:38:13 2014 +0100
+++ b/hedgewars/uTextures.pas Tue Jan 21 22:43:06 2014 +0100
@@ -107,11 +107,11 @@
fromP4:= Surf^.pixels;
for y:= 0 to Pred(Surf^.h) do
begin
- for x:= 0 to Pred(Surf^.w) do
+ for x:= 0 to Pred(Surf^.w) do
begin
tw:= fromP4^[x];
- tw:= round((tw shr RShift and $FF) * RGB_LUMINANCE_RED +
- (tw shr GShift and $FF) * RGB_LUMINANCE_GREEN +
+ tw:= round((tw shr RShift and $FF) * RGB_LUMINANCE_RED +
+ (tw shr GShift and $FF) * RGB_LUMINANCE_GREEN +
(tw shr BShift and $FF) * RGB_LUMINANCE_BLUE);
if tw > 255 then tw:= 255;
tw:= (tw and $FF shl RShift) or (tw and $FF shl BShift) or (tw and $FF shl GShift) or (fromP4^[x] and AMask);
@@ -242,7 +242,7 @@
begin
if TextureList <> nil then
WriteToConsole('FIXME FIXME FIXME. App shutdown without full cleanup of texture list; read game0.log and please report this problem');
- while TextureList <> nil do
+ while TextureList <> nil do
begin
AddFileLog('Texture not freed: width='+inttostr(LongInt(TextureList^.w))+' height='+inttostr(LongInt(TextureList^.h))+' priority='+inttostr(round(TextureList^.priority*1000)));
FreeTexture(TextureList);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lapi.c
--- a/misc/liblua/lapi.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lapi.c Tue Jan 21 22:43:06 2014 +0100
@@ -38,9 +38,9 @@
-#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base))
+#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base))
-#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject)
+#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject)
#define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;}
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lauxlib.h
--- a/misc/liblua/lauxlib.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lauxlib.h Tue Jan 21 22:43:06 2014 +0100
@@ -24,7 +24,7 @@
#endif
#if defined(LUA_COMPAT_OPENLIB)
-#define luaI_openlib luaL_openlib
+#define luaI_openlib luaL_openlib
#endif
@@ -97,26 +97,26 @@
** ===============================================================
*/
-#define luaL_argcheck(L, cond,numarg,extramsg) \
- ((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
-#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
-#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
-#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
-#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
-#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
-#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
+#define luaL_argcheck(L, cond,numarg,extramsg) \
+ ((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
+#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
+#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
+#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
+#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
+#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
+#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
-#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
+#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
#define luaL_dofile(L, fn) \
- (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
+ (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
#define luaL_dostring(L, s) \
- (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
+ (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
-#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
+#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
-#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
+#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
/*
** {======================================================
@@ -127,7 +127,7 @@
typedef struct luaL_Buffer {
- char *p; /* current position in buffer */
+ char *p; /* current position in buffer */
int lvl; /* number of strings in the stack (level) */
lua_State *L;
char buffer[LUAL_BUFFERSIZE];
@@ -138,9 +138,9 @@
(*(B)->p++ = (char)(c)))
/* compatibility only */
-#define luaL_putchar(B,c) luaL_addchar(B,c)
+#define luaL_putchar(B,c) luaL_addchar(B,c)
-#define luaL_addsize(B,n) ((B)->p += (n))
+#define luaL_addsize(B,n) ((B)->p += (n))
LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
@@ -167,7 +167,7 @@
#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
-#define luaL_reg luaL_Reg
+#define luaL_reg luaL_Reg
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lbaselib.c
--- a/misc/liblua/lbaselib.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lbaselib.c Tue Jan 21 22:43:06 2014 +0100
@@ -479,10 +479,10 @@
** =======================================================
*/
-#define CO_RUN 0 /* running */
-#define CO_SUS 1 /* suspended */
-#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */
-#define CO_DEAD 3
+#define CO_RUN 0 /* running */
+#define CO_SUS 1 /* suspended */
+#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */
+#define CO_DEAD 3
static const char *const statnames[] =
{"running", "suspended", "normal", "dead"};
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lcode.c
--- a/misc/liblua/lcode.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lcode.c Tue Jan 21 22:43:06 2014 +0100
@@ -24,7 +24,7 @@
#include "ltable.h"
-#define hasjumps(e) ((e)->t != (e)->f)
+#define hasjumps(e) ((e)->t != (e)->f)
static int isnumeral(expdesc *e) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lcode.h
--- a/misc/liblua/lcode.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lcode.h Tue Jan 21 22:43:06 2014 +0100
@@ -36,11 +36,11 @@
typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
-#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info])
+#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info])
-#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
+#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
-#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
+#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ldblib.c
--- a/misc/liblua/ldblib.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ldblib.c Tue Jan 21 22:43:06 2014 +0100
@@ -315,8 +315,8 @@
}
-#define LEVELS1 12 /* size of the first part of the stack */
-#define LEVELS2 10 /* size of the second part of the stack */
+#define LEVELS1 12 /* size of the first part of the stack */
+#define LEVELS2 10 /* size of the second part of the stack */
static int db_errorfb (lua_State *L) {
int level;
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ldebug.c
--- a/misc/liblua/ldebug.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ldebug.c Tue Jan 21 22:43:06 2014 +0100
@@ -265,11 +265,11 @@
** =======================================================
*/
-#define check(x) if (!(x)) return 0;
+#define check(x) if (!(x)) return 0;
-#define checkjump(pt,pc) check(0 <= pc && pc < pt->sizecode)
+#define checkjump(pt,pc) check(0 <= pc && pc < pt->sizecode)
-#define checkreg(pt,reg) check((reg) < (pt)->maxstacksize)
+#define checkreg(pt,reg) check((reg) < (pt)->maxstacksize)
@@ -285,7 +285,7 @@
}
-#define checkopenop(pt,pc) luaG_checkopenop((pt)->code[(pc)+1])
+#define checkopenop(pt,pc) luaG_checkopenop((pt)->code[(pc)+1])
int luaG_checkopenop (Instruction i) {
switch (GET_OPCODE(i)) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ldebug.h
--- a/misc/liblua/ldebug.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ldebug.h Tue Jan 21 22:43:06 2014 +0100
@@ -11,11 +11,11 @@
#include "lstate.h"
-#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
+#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
-#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
+#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
-#define resethookcount(L) (L->hookcount = L->basehookcount)
+#define resethookcount(L) (L->hookcount = L->basehookcount)
LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ldo.h
--- a/misc/liblua/ldo.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ldo.h Tue Jan 21 22:43:06 2014 +0100
@@ -13,7 +13,7 @@
#include "lzio.h"
-#define luaD_checkstack(L,n) \
+#define luaD_checkstack(L,n) \
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
luaD_growstack(L, n); \
else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
@@ -21,17 +21,17 @@
#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
-#define savestack(L,p) ((char *)(p) - (char *)L->stack)
-#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
+#define savestack(L,p) ((char *)(p) - (char *)L->stack)
+#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
-#define saveci(L,p) ((char *)(p) - (char *)L->base_ci)
-#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n)))
+#define saveci(L,p) ((char *)(p) - (char *)L->base_ci)
+#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n)))
/* results from luaD_precall */
-#define PCRLUA 0 /* initiated a call to a Lua function */
-#define PCRC 1 /* did a call to a C function */
-#define PCRYIELD 2 /* C funtion yielded */
+#define PCRLUA 0 /* initiated a call to a Lua function */
+#define PCRC 1 /* did a call to a C function */
+#define PCRYIELD 2 /* C funtion yielded */
/* type of protected functions, to be ran by `runprotected' */
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ldump.c
--- a/misc/liblua/ldump.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ldump.c Tue Jan 21 22:43:06 2014 +0100
@@ -23,8 +23,8 @@
int status;
} DumpState;
-#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D)
-#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D)
+#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D)
+#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D)
static void DumpBlock(const void* b, size_t size, DumpState* D)
{
@@ -67,13 +67,13 @@
}
else
{
- size_t size=s->tsv.len+1; /* include trailing '\0' */
+ size_t size=s->tsv.len+1; /* include trailing '\0' */
DumpVar(size,D);
DumpBlock(getstr(s),size,D);
}
}
-#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D)
+#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D)
static void DumpFunction(const Proto* f, const TString* p, DumpState* D);
@@ -88,19 +88,19 @@
switch (ttype(o))
{
case LUA_TNIL:
- break;
+ break;
case LUA_TBOOLEAN:
- DumpChar(bvalue(o),D);
- break;
+ DumpChar(bvalue(o),D);
+ break;
case LUA_TNUMBER:
- DumpNumber(nvalue(o),D);
- break;
+ DumpNumber(nvalue(o),D);
+ break;
case LUA_TSTRING:
- DumpString(rawtsvalue(o),D);
- break;
+ DumpString(rawtsvalue(o),D);
+ break;
default:
- lua_assert(0); /* cannot happen */
- break;
+ lua_assert(0); /* cannot happen */
+ break;
}
}
n=f->sizep;
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lfunc.h
--- a/misc/liblua/lfunc.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lfunc.h Tue Jan 21 22:43:06 2014 +0100
@@ -11,10 +11,10 @@
#include "lobject.h"
-#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
+#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
cast(int, sizeof(TValue)*((n)-1)))
-#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
+#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
cast(int, sizeof(TValue *)*((n)-1)))
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lgc.c
--- a/misc/liblua/lgc.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lgc.c Tue Jan 21 22:43:06 2014 +0100
@@ -23,25 +23,25 @@
#include "ltm.h"
-#define GCSTEPSIZE 1024u
-#define GCSWEEPMAX 40
-#define GCSWEEPCOST 10
-#define GCFINALIZECOST 100
+#define GCSTEPSIZE 1024u
+#define GCSWEEPMAX 40
+#define GCSWEEPCOST 10
+#define GCFINALIZECOST 100
-#define maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS))
+#define maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS))
-#define makewhite(g,x) \
+#define makewhite(g,x) \
((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g)))
-#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
-#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT)
+#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
+#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT)
-#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)
+#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)
-#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT)
-#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT)
+#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT)
+#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT)
#define KEYWEAK bitmask(KEYWEAKBIT)
@@ -53,7 +53,7 @@
if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); }
#define markobject(g,t) { if (iswhite(obj2gco(t))) \
- reallymarkobject(g, obj2gco(t)); }
+ reallymarkobject(g, obj2gco(t)); }
#define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause)
@@ -401,7 +401,7 @@
-#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM)
+#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM)
static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lgc.h
--- a/misc/liblua/lgc.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lgc.h Tue Jan 21 22:43:06 2014 +0100
@@ -14,27 +14,27 @@
/*
** Possible states of the Garbage Collector
*/
-#define GCSpause 0
-#define GCSpropagate 1
-#define GCSsweepstring 2
-#define GCSsweep 3
-#define GCSfinalize 4
+#define GCSpause 0
+#define GCSpropagate 1
+#define GCSsweepstring 2
+#define GCSsweep 3
+#define GCSfinalize 4
/*
** some userful bit tricks
*/
-#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
-#define setbits(x,m) ((x) |= (m))
-#define testbits(x,m) ((x) & (m))
-#define bitmask(b) (1<<(b))
-#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
-#define l_setbit(x,b) setbits(x, bitmask(b))
-#define resetbit(x,b) resetbits(x, bitmask(b))
-#define testbit(x,b) testbits(x, bitmask(b))
-#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2)))
-#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2)))
-#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2)))
+#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
+#define setbits(x,m) ((x) |= (m))
+#define testbits(x,m) ((x) & (m))
+#define bitmask(b) (1<<(b))
+#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
+#define l_setbit(x,b) setbits(x, bitmask(b))
+#define resetbit(x,b) resetbits(x, bitmask(b))
+#define testbit(x,b) testbits(x, bitmask(b))
+#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2)))
+#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2)))
+#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2)))
@@ -51,47 +51,47 @@
*/
-#define WHITE0BIT 0
-#define WHITE1BIT 1
-#define BLACKBIT 2
-#define FINALIZEDBIT 3
-#define KEYWEAKBIT 3
-#define VALUEWEAKBIT 4
-#define FIXEDBIT 5
-#define SFIXEDBIT 6
-#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
+#define WHITE0BIT 0
+#define WHITE1BIT 1
+#define BLACKBIT 2
+#define FINALIZEDBIT 3
+#define KEYWEAKBIT 3
+#define VALUEWEAKBIT 4
+#define FIXEDBIT 5
+#define SFIXEDBIT 6
+#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
#define isblack(x) testbit((x)->gch.marked, BLACKBIT)
-#define isgray(x) (!isblack(x) && !iswhite(x))
+#define isgray(x) (!isblack(x) && !iswhite(x))
-#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
-#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS)
+#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
+#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS)
-#define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
-#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
+#define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
+#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
-#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
+#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
-#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
+#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
#define luaC_checkGC(L) { \
condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
if (G(L)->totalbytes >= G(L)->GCthreshold) \
- luaC_step(L); }
+ luaC_step(L); }
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
- luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
+ luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \
- luaC_barrierback(L,t); }
+ luaC_barrierback(L,t); }
#define luaC_objbarrier(L,p,o) \
- { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
- luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
+ { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
+ luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
#define luaC_objbarriert(L,t,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/liolib.c
--- a/misc/liblua/liolib.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/liolib.c Tue Jan 21 22:43:06 2014 +0100
@@ -20,8 +20,8 @@
-#define IO_INPUT 1
-#define IO_OUTPUT 2
+#define IO_INPUT 1
+#define IO_OUTPUT 2
static const char *const fnames[] = {"input", "output"};
@@ -51,7 +51,7 @@
}
-#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
+#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
static int io_type (lua_State *L) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/llex.c
--- a/misc/liblua/llex.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/llex.c Tue Jan 21 22:43:06 2014 +0100
@@ -30,7 +30,7 @@
-#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
+#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
/* ORDER RESERVED */
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/llex.h
--- a/misc/liblua/llex.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/llex.h Tue Jan 21 22:43:06 2014 +0100
@@ -11,10 +11,10 @@
#include "lzio.h"
-#define FIRST_RESERVED 257
+#define FIRST_RESERVED 257
/* maximum length of a reserved word */
-#define TOKEN_LEN (sizeof("function")/sizeof(char))
+#define TOKEN_LEN (sizeof("function")/sizeof(char))
/*
@@ -33,7 +33,7 @@
};
/* number of reserved words */
-#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1))
+#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1))
/* array with token `names' */
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/llimits.h
--- a/misc/liblua/llimits.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/llimits.h Tue Jan 21 22:43:06 2014 +0100
@@ -27,9 +27,9 @@
typedef unsigned char lu_byte;
-#define MAX_SIZET ((size_t)(~(size_t)0)-2)
+#define MAX_SIZET ((size_t)(~(size_t)0)-2)
-#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2)
+#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2)
#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */
@@ -54,30 +54,30 @@
/* internal assertions for in-house debugging */
#ifdef lua_assert
-#define check_exp(c,e) (lua_assert(c), (e))
-#define api_check(l,e) lua_assert(e)
+#define check_exp(c,e) (lua_assert(c), (e))
+#define api_check(l,e) lua_assert(e)
#else
-#define lua_assert(c) ((void)0)
-#define check_exp(c,e) (e)
-#define api_check luai_apicheck
+#define lua_assert(c) ((void)0)
+#define check_exp(c,e) (e)
+#define api_check luai_apicheck
#endif
#ifndef UNUSED
-#define UNUSED(x) ((void)(x)) /* to avoid warnings */
+#define UNUSED(x) ((void)(x)) /* to avoid warnings */
#endif
#ifndef cast
-#define cast(t, exp) ((t)(exp))
+#define cast(t, exp) ((t)(exp))
#endif
-#define cast_byte(i) cast(lu_byte, (i))
-#define cast_num(i) cast(lua_Number, (i))
-#define cast_int(i) cast(int, (i))
+#define cast_byte(i) cast(lu_byte, (i))
+#define cast_num(i) cast(lua_Number, (i))
+#define cast_int(i) cast(int, (i))
@@ -90,19 +90,19 @@
/* maximum stack for a Lua function */
-#define MAXSTACK 250
+#define MAXSTACK 250
/* minimum size for the string table (must be power of 2) */
#ifndef MINSTRTABSIZE
-#define MINSTRTABSIZE 32
+#define MINSTRTABSIZE 32
#endif
/* minimum size for string buffer */
#ifndef LUA_MINBUFFER
-#define LUA_MINBUFFER 32
+#define LUA_MINBUFFER 32
#endif
@@ -120,9 +120,9 @@
** macro to control inclusion of some hard tests on stack reallocation
*/
#ifndef HARDSTACKTESTS
-#define condhardstacktests(x) ((void)0)
+#define condhardstacktests(x) ((void)0)
#else
-#define condhardstacktests(x) x
+#define condhardstacktests(x) x
#endif
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lmem.c
--- a/misc/liblua/lmem.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lmem.c Tue Jan 21 22:43:06 2014 +0100
@@ -40,7 +40,7 @@
-#define MINSIZEARRAY 4
+#define MINSIZEARRAY 4
void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems,
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lmem.h
--- a/misc/liblua/lmem.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lmem.h Tue Jan 21 22:43:06 2014 +0100
@@ -13,22 +13,22 @@
#include "llimits.h"
#include "lua.h"
-#define MEMERRMSG "not enough memory"
+#define MEMERRMSG "not enough memory"
#define luaM_reallocv(L,b,on,n,e) \
- ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
- luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
- luaM_toobig(L))
+ ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
+ luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
+ luaM_toobig(L))
-#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
-#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
+#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
+#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t))
-#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t))
-#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
+#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t))
+#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
#define luaM_newvector(L,n,t) \
- cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
+ cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define luaM_growvector(L,v,nelems,size,t,limit,e) \
if ((nelems)+1 > (size)) \
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/loadlib.c
--- a/misc/liblua/loadlib.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/loadlib.c Tue Jan 21 22:43:06 2014 +0100
@@ -23,23 +23,23 @@
/* prefix for open functions in C libraries */
-#define LUA_POF "luaopen_"
+#define LUA_POF "luaopen_"
/* separator for open functions in C libraries */
-#define LUA_OFSEP "_"
+#define LUA_OFSEP "_"
-#define LIBPREFIX "LOADLIB: "
+#define LIBPREFIX "LOADLIB: "
-#define POF LUA_POF
-#define LIB_FAIL "open"
+#define POF LUA_POF
+#define LIB_FAIL "open"
/* error codes for ll_loadfunc */
-#define ERRLIB 1
-#define ERRFUNC 2
+#define ERRLIB 1
+#define ERRFUNC 2
-#define setprogdir(L) ((void)0)
+#define setprogdir(L) ((void)0)
static void ll_unloadlib (void *lib);
@@ -153,7 +153,7 @@
/* Mac appends a `_' before C function names */
#undef POF
-#define POF "_" LUA_POF
+#define POF "_" LUA_POF
static void pusherror (lua_State *L) {
@@ -230,10 +230,10 @@
*/
#undef LIB_FAIL
-#define LIB_FAIL "absent"
+#define LIB_FAIL "absent"
-#define DLMSG "dynamic libraries not enabled; check your Lua installation"
+#define DLMSG "dynamic libraries not enabled; check your Lua installation"
static void ll_unloadlib (void *lib) {
@@ -445,7 +445,7 @@
static const int sentinel_ = 0;
-#define sentinel ((void *)&sentinel_)
+#define sentinel ((void *)&sentinel_)
static int ll_require (lua_State *L) {
@@ -587,7 +587,7 @@
/* auxiliary mark (for internal use) */
-#define AUXMARK "\1"
+#define AUXMARK "\1"
static void setpath (lua_State *L, const char *fieldname, const char *envname,
const char *def) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lobject.h
--- a/misc/liblua/lobject.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lobject.h Tue Jan 21 22:43:06 2014 +0100
@@ -17,17 +17,17 @@
/* tags for values visible from Lua */
-#define LAST_TAG LUA_TTHREAD
+#define LAST_TAG LUA_TTHREAD
-#define NUM_TAGS (LAST_TAG+1)
+#define NUM_TAGS (LAST_TAG+1)
/*
** Extra tags for non-values
*/
-#define LUA_TPROTO (LAST_TAG+1)
-#define LUA_TUPVAL (LAST_TAG+2)
-#define LUA_TDEADKEY (LAST_TAG+3)
+#define LUA_TPROTO (LAST_TAG+1)
+#define LUA_TUPVAL (LAST_TAG+2)
+#define LUA_TDEADKEY (LAST_TAG+3)
/*
@@ -40,7 +40,7 @@
** Common Header for all collectable objects (in macro form, to be
** included in other objects)
*/
-#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked
+#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked
/*
@@ -68,7 +68,7 @@
** Tagged Values
*/
-#define TValuefields Value value; int tt
+#define TValuefields Value value; int tt
typedef struct lua_TValue {
TValuefields;
@@ -76,31 +76,31 @@
/* Macros to test type */
-#define ttisnil(o) (ttype(o) == LUA_TNIL)
-#define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
-#define ttisstring(o) (ttype(o) == LUA_TSTRING)
-#define ttistable(o) (ttype(o) == LUA_TTABLE)
-#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION)
-#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN)
-#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA)
-#define ttisthread(o) (ttype(o) == LUA_TTHREAD)
-#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA)
+#define ttisnil(o) (ttype(o) == LUA_TNIL)
+#define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
+#define ttisstring(o) (ttype(o) == LUA_TSTRING)
+#define ttistable(o) (ttype(o) == LUA_TTABLE)
+#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION)
+#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN)
+#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA)
+#define ttisthread(o) (ttype(o) == LUA_TTHREAD)
+#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA)
/* Macros to access values */
-#define ttype(o) ((o)->tt)
-#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc)
-#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p)
-#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n)
-#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts)
-#define tsvalue(o) (&rawtsvalue(o)->tsv)
-#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u)
-#define uvalue(o) (&rawuvalue(o)->uv)
-#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl)
-#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h)
-#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b)
-#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th)
+#define ttype(o) ((o)->tt)
+#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc)
+#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p)
+#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n)
+#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts)
+#define tsvalue(o) (&rawtsvalue(o)->tsv)
+#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u)
+#define uvalue(o) (&rawuvalue(o)->uv)
+#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl)
+#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h)
+#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b)
+#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th)
-#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
+#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
/*
** for internal debug only
@@ -169,24 +169,24 @@
*/
/* from stack to (same) stack */
-#define setobjs2s setobj
+#define setobjs2s setobj
/* to stack (not from same stack) */
-#define setobj2s setobj
-#define setsvalue2s setsvalue
-#define sethvalue2s sethvalue
-#define setptvalue2s setptvalue
+#define setobj2s setobj
+#define setsvalue2s setsvalue
+#define sethvalue2s sethvalue
+#define setptvalue2s setptvalue
/* from table to same table */
-#define setobjt2t setobj
+#define setobjt2t setobj
/* to table */
-#define setobj2t setobj
+#define setobj2t setobj
/* to new object */
-#define setobj2n setobj
-#define setsvalue2n setsvalue
+#define setobj2n setobj
+#define setsvalue2n setsvalue
#define setttype(obj, tt) (ttype(obj) = (tt))
-#define iscollectable(o) (ttype(o) >= LUA_TSTRING)
+#define iscollectable(o) (ttype(o) >= LUA_TSTRING)
@@ -207,7 +207,7 @@
} TString;
-#define getstr(ts) cast(const char *, (ts) + 1)
+#define getstr(ts) cast(const char *, (ts) + 1)
#define svalue(o) getstr(rawtsvalue(o))
@@ -254,9 +254,9 @@
/* masks for new-style vararg */
-#define VARARG_HASARG 1
-#define VARARG_ISVARARG 2
-#define VARARG_NEEDSARG 4
+#define VARARG_HASARG 1
+#define VARARG_ISVARARG 2
+#define VARARG_NEEDSARG 4
typedef struct LocVar {
@@ -289,8 +289,8 @@
*/
#define ClosureHeader \
- CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \
- struct Table *env
+ CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \
+ struct Table *env
typedef struct CClosure {
ClosureHeader;
@@ -312,8 +312,8 @@
} Closure;
-#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)
-#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)
+#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)
+#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)
/*
@@ -353,18 +353,18 @@
** `module' operation for hashing (size is always a power of 2)
*/
#define lmod(s,size) \
- (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
+ (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
-#define twoto(x) (1<<(x))
-#define sizenode(t) (twoto((t)->lsizenode))
+#define twoto(x) (1<<(x))
+#define sizenode(t) (twoto((t)->lsizenode))
-#define luaO_nilobject (&luaO_nilobject_)
+#define luaO_nilobject (&luaO_nilobject_)
LUAI_DATA const TValue luaO_nilobject_;
-#define ceillog2(x) (luaO_log2((x)-1) + 1)
+#define ceillog2(x) (luaO_log2((x)-1) + 1)
LUAI_FUNC int luaO_log2 (unsigned int x);
LUAI_FUNC int luaO_int2fb (unsigned int x);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lopcodes.c
--- a/misc/liblua/lopcodes.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lopcodes.c Tue Jan 21 22:43:06 2014 +0100
@@ -59,44 +59,44 @@
#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
const lu_byte luaP_opmodes[NUM_OPCODES] = {
-/* T A B C mode opcode */
- opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
- ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */
- ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */
- ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */
- ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */
- ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */
- ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */
- ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */
- ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */
- ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */
- ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */
- ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */
- ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */
- ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */
- ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */
- ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */
- ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */
- ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */
- ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */
- ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */
- ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */
- ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */
- ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */
- ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */
- ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */
- ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */
- ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */
- ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */
- ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */
- ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */
- ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */
- ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */
- ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */
- ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */
- ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */
- ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */
- ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */
- ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */
+/* T A B C mode opcode */
+ opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
+ ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */
+ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */
+ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */
+ ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */
+ ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */
+ ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */
+ ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */
+ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */
+ ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */
+ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */
+ ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */
+ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */
+ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */
+ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */
+ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */
+ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */
+ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */
+ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */
+ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */
+ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */
+ ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */
+ ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */
+ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */
+ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */
+ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */
+ ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */
+ ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */
+ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */
+ ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */
+ ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */
+ ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */
+ ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */
+ ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */
+ ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */
+ ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */
+ ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */
+ ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */
};
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lopcodes.h
--- a/misc/liblua/lopcodes.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lopcodes.h Tue Jan 21 22:43:06 2014 +0100
@@ -14,11 +14,11 @@
We assume that instructions are unsigned numbers.
All instructions have an opcode in the first 6 bits.
Instructions can have the following fields:
- `A' : 8 bits
- `B' : 9 bits
- `C' : 9 bits
- `Bx' : 18 bits (`B' and `C' together)
- `sBx' : signed Bx
+ `A' : 8 bits
+ `B' : 9 bits
+ `C' : 9 bits
+ `Bx' : 18 bits (`B' and `C' together)
+ `sBx' : signed Bx
A signed argument is represented in excess K; that is, the number
value is the unsigned value minus K. K is exactly the maximum value
@@ -34,18 +34,18 @@
/*
** size and position of opcode arguments.
*/
-#define SIZE_C 9
-#define SIZE_B 9
-#define SIZE_Bx (SIZE_C + SIZE_B)
-#define SIZE_A 8
+#define SIZE_C 9
+#define SIZE_B 9
+#define SIZE_Bx (SIZE_C + SIZE_B)
+#define SIZE_A 8
-#define SIZE_OP 6
+#define SIZE_OP 6
-#define POS_OP 0
-#define POS_A (POS_OP + SIZE_OP)
-#define POS_C (POS_A + SIZE_A)
-#define POS_B (POS_C + SIZE_C)
-#define POS_Bx POS_C
+#define POS_OP 0
+#define POS_A (POS_OP + SIZE_OP)
+#define POS_C (POS_A + SIZE_A)
+#define POS_B (POS_C + SIZE_C)
+#define POS_Bx POS_C
/*
@@ -68,47 +68,47 @@
/* creates a mask with `n' 1 bits at position `p' */
-#define MASK1(n,p) ((~((~(Instruction)0)<>POS_OP) & MASK1(SIZE_OP,0)))
-#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
- ((cast(Instruction, o)<>POS_OP) & MASK1(SIZE_OP,0)))
+#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
+ ((cast(Instruction, o)<>POS_A) & MASK1(SIZE_A,0)))
-#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
- ((cast(Instruction, u)<>POS_A) & MASK1(SIZE_A,0)))
+#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
+ ((cast(Instruction, u)<>POS_B) & MASK1(SIZE_B,0)))
-#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \
- ((cast(Instruction, b)<>POS_B) & MASK1(SIZE_B,0)))
+#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \
+ ((cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0)))
-#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \
- ((cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0)))
+#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \
+ ((cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0)))
-#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \
- ((cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0)))
+#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \
+ ((cast(Instruction, b)< C) then pc++ */
-OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
+OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
+OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
-OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
-OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
-OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
+OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
+OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
+OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
-OP_FORLOOP,/* A sBx R(A)+=R(A+2);
- if R(A) = R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
-OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
+OP_FORLOOP,/* A sBx R(A)+=R(A+2);
+ if R(A) = R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
+OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
-OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
- if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
-OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
+OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
+ if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
+OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
-OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
-OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */
+OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
+OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */
-OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
+OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
} OpCode;
-#define NUM_OPCODES (cast(int, OP_VARARG) + 1)
+#define NUM_OPCODES (cast(int, OP_VARARG) + 1)
@@ -251,18 +251,18 @@
LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];
-#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
-#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
-#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
-#define testAMode(m) (luaP_opmodes[m] & (1 << 6))
-#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
+#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
+#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
+#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
+#define testAMode(m) (luaP_opmodes[m] & (1 << 6))
+#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
/* number of list items to accumulate before a SETLIST instruction */
-#define LFIELDS_PER_FLUSH 50
+#define LFIELDS_PER_FLUSH 50
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lparser.c
--- a/misc/liblua/lparser.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lparser.c Tue Jan 21 22:43:06 2014 +0100
@@ -27,11 +27,11 @@
-#define hasmultret(k) ((k) == VCALL || (k) == VVARARG)
+#define hasmultret(k) ((k) == VCALL || (k) == VVARARG)
-#define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]])
+#define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]])
-#define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m)
+#define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m)
/*
@@ -97,7 +97,7 @@
}
-#define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); }
+#define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); }
@@ -275,11 +275,11 @@
static void enterlevel (LexState *ls) {
if (++ls->L->nCcalls > LUAI_MAXCCALLS)
- luaX_lexerror(ls, "chunk has too many syntax levels", 0);
+ luaX_lexerror(ls, "chunk has too many syntax levels", 0);
}
-#define leavelevel(ls) ((ls)->L->nCcalls--)
+#define leavelevel(ls) ((ls)->L->nCcalls--)
static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) {
@@ -818,7 +818,7 @@
{2, 2}, {1, 1} /* logical (and/or) */
};
-#define UNARY_PRIORITY 8 /* priority for unary operators */
+#define UNARY_PRIORITY 8 /* priority for unary operators */
/*
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lparser.h
--- a/misc/liblua/lparser.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lparser.h Tue Jan 21 22:43:06 2014 +0100
@@ -17,21 +17,21 @@
*/
typedef enum {
- VVOID, /* no value */
+ VVOID, /* no value */
VNIL,
VTRUE,
VFALSE,
- VK, /* info = index of constant in `k' */
- VKNUM, /* nval = numerical value */
- VLOCAL, /* info = local register */
+ VK, /* info = index of constant in `k' */
+ VKNUM, /* nval = numerical value */
+ VLOCAL, /* info = local register */
VUPVAL, /* info = index of upvalue in `upvalues' */
- VGLOBAL, /* info = index of table; aux = index of global name in `k' */
- VINDEXED, /* info = table register; aux = index register (or `k') */
- VJMP, /* info = instruction pc */
- VRELOCABLE, /* info = instruction pc */
- VNONRELOC, /* info = result register */
- VCALL, /* info = instruction pc */
- VVARARG /* info = instruction pc */
+ VGLOBAL, /* info = index of table; aux = index of global name in `k' */
+ VINDEXED, /* info = table register; aux = index register (or `k') */
+ VJMP, /* info = instruction pc */
+ VRELOCABLE, /* info = instruction pc */
+ VNONRELOC, /* info = result register */
+ VCALL, /* info = instruction pc */
+ VVARARG /* info = instruction pc */
} expkind;
typedef struct expdesc {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lstate.c
--- a/misc/liblua/lstate.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lstate.c Tue Jan 21 22:43:06 2014 +0100
@@ -24,8 +24,8 @@
#include "ltm.h"
-#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE)
-#define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE)
+#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE)
+#define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE)
#define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE))
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lstate.h
--- a/misc/liblua/lstate.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lstate.h Tue Jan 21 22:43:06 2014 +0100
@@ -19,10 +19,10 @@
/* table of globals */
-#define gt(L) (&L->l_gt)
+#define gt(L) (&L->l_gt)
/* registry */
-#define registry(L) (&G(L)->l_registry)
+#define registry(L) (&G(L)->l_registry)
/* extra stack space to handle TM calls and some other extras */
@@ -48,7 +48,7 @@
typedef struct CallInfo {
StkId base; /* base for this function */
StkId func; /* function index in the stack */
- StkId top; /* top for this function */
+ StkId top; /* top for this function */
const Instruction *savedpc;
int nresults; /* expected number of results from this function */
int tailcalls; /* number of tail calls lost under this entry */
@@ -56,10 +56,10 @@
-#define curr_func(L) (clvalue(L->ci->func))
-#define ci_func(ci) (clvalue((ci)->func))
-#define f_isLua(ci) (!ci_func(ci)->c.isC)
-#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci))
+#define curr_func(L) (clvalue(L->ci->func))
+#define ci_func(ci) (clvalue((ci)->func))
+#define f_isLua(ci) (!ci_func(ci)->c.isC)
+#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci))
/*
@@ -127,7 +127,7 @@
};
-#define G(L) (L->l_G)
+#define G(L) (L->l_G)
/*
@@ -146,20 +146,20 @@
/* macros to convert a GCObject into a specific value */
-#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
-#define gco2ts(o) (&rawgco2ts(o)->tsv)
-#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
-#define gco2u(o) (&rawgco2u(o)->uv)
-#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
-#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
-#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
-#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
+#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
+#define gco2ts(o) (&rawgco2ts(o)->tsv)
+#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
+#define gco2u(o) (&rawgco2u(o)->uv)
+#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
+#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
+#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
+#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
#define ngcotouv(o) \
- check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
-#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
+ check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
+#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
/* macro to convert any Lua object into a GCObject */
-#define obj2gco(v) (cast(GCObject *, (v)))
+#define obj2gco(v) (cast(GCObject *, (v)))
LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lstring.h
--- a/misc/liblua/lstring.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lstring.h Tue Jan 21 22:43:06 2014 +0100
@@ -13,15 +13,15 @@
#include "lstate.h"
-#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
+#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
-#define sizeudata(u) (sizeof(union Udata)+(u)->len)
+#define sizeudata(u) (sizeof(union Udata)+(u)->len)
-#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
-#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
+#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
+#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
-#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
+#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lstrlib.c
--- a/misc/liblua/lstrlib.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lstrlib.c Tue Jan 21 22:43:06 2014 +0100
@@ -164,8 +164,8 @@
*/
-#define CAP_UNFINISHED (-1)
-#define CAP_POSITION (-2)
+#define CAP_UNFINISHED (-1)
+#define CAP_POSITION (-2)
typedef struct MatchState {
const char *src_init; /* init of source string */
@@ -179,8 +179,8 @@
} MatchState;
-#define L_ESC '%'
-#define SPECIALS "^$*+?.([%-"
+#define L_ESC '%'
+#define SPECIALS "^$*+?.([%-"
static int check_capture (MatchState *ms, int l) {
@@ -683,14 +683,14 @@
/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */
-#define MAX_ITEM 512
+#define MAX_ITEM 512
/* valid flags in a format specification */
-#define FLAGS "-+ #0"
+#define FLAGS "-+ #0"
/*
** maximum size of each format specification (such as '%-099.99d')
** (+10 accounts for %99.99x plus margin of error)
*/
-#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10)
+#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10)
static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ltable.c
--- a/misc/liblua/ltable.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ltable.c Tue Jan 21 22:43:06 2014 +0100
@@ -39,12 +39,12 @@
** max size of array part is 2^MAXBITS
*/
#if LUAI_BITSINT > 26
-#define MAXBITS 26
+#define MAXBITS 26
#else
-#define MAXBITS (LUAI_BITSINT-2)
+#define MAXBITS (LUAI_BITSINT-2)
#endif
-#define MAXASIZE (1 << MAXBITS)
+#define MAXASIZE (1 << MAXBITS)
#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t))))
@@ -57,20 +57,20 @@
** for some types, it is better to avoid modulus by power of 2, as
** they tend to have many 2 factors.
*/
-#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
+#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
-#define hashpointer(t,p) hashmod(t, IntPoint(p))
+#define hashpointer(t,p) hashmod(t, IntPoint(p))
/*
** number of ints inside a lua_Number
*/
-#define numints cast_int(sizeof(lua_Number)/sizeof(int))
+#define numints cast_int(sizeof(lua_Number)/sizeof(int))
-#define dummynode (&dummynode_)
+#define dummynode (&dummynode_)
static const Node dummynode_ = {
{{NULL}, LUA_TNIL}, /* value */
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ltable.h
--- a/misc/liblua/ltable.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ltable.h Tue Jan 21 22:43:06 2014 +0100
@@ -10,12 +10,12 @@
#include "lobject.h"
-#define gnode(t,i) (&(t)->node[i])
-#define gkey(n) (&(n)->i_key.nk)
-#define gval(n) (&(n)->i_val)
-#define gnext(n) ((n)->i_key.nk.next)
+#define gnode(t,i) (&(t)->node[i])
+#define gkey(n) (&(n)->i_key.nk)
+#define gval(n) (&(n)->i_val)
+#define gnext(n) ((n)->i_key.nk.next)
-#define key2tval(n) (&(n)->i_key.tvk)
+#define key2tval(n) (&(n)->i_key.tvk)
LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ltablib.c
--- a/misc/liblua/ltablib.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ltablib.c Tue Jan 21 22:43:06 2014 +0100
@@ -16,7 +16,7 @@
#include "lualib.h"
-#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))
+#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))
static int foreachi (lua_State *L) {
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/ltm.h
--- a/misc/liblua/ltm.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/ltm.h Tue Jan 21 22:43:06 2014 +0100
@@ -33,7 +33,7 @@
TM_LE,
TM_CONCAT,
TM_CALL,
- TM_N /* number of elements in the enum */
+ TM_N /* number of elements in the enum */
} TMS;
@@ -41,7 +41,7 @@
#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
-#define fasttm(l,et,e) gfasttm(G(l), et, e)
+#define fasttm(l,et,e) gfasttm(G(l), et, e)
LUAI_DATA const char *const luaT_typenames[];
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lua.h
--- a/misc/liblua/lua.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lua.h Tue Jan 21 22:43:06 2014 +0100
@@ -16,35 +16,35 @@
#include "luaconf.h"
-#define LUA_VERSION "Lua 5.1"
-#define LUA_RELEASE "Lua 5.1.4"
-#define LUA_VERSION_NUM 501
-#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
-#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
+#define LUA_VERSION "Lua 5.1"
+#define LUA_RELEASE "Lua 5.1.4"
+#define LUA_VERSION_NUM 501
+#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
+#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
/* mark for precompiled code (`Lua') */
-#define LUA_SIGNATURE "\033Lua"
+#define LUA_SIGNATURE "\033Lua"
/* option for multiple returns in `lua_pcall' and `lua_call' */
-#define LUA_MULTRET (-1)
+#define LUA_MULTRET (-1)
/*
** pseudo-indices
*/
-#define LUA_REGISTRYINDEX (-10000)
-#define LUA_ENVIRONINDEX (-10001)
-#define LUA_GLOBALSINDEX (-10002)
-#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
+#define LUA_REGISTRYINDEX (-10000)
+#define LUA_ENVIRONINDEX (-10001)
+#define LUA_GLOBALSINDEX (-10002)
+#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
/* thread status; 0 is OK */
-#define LUA_YIELD 1
-#define LUA_ERRRUN 2
-#define LUA_ERRSYNTAX 3
-#define LUA_ERRMEM 4
-#define LUA_ERRERR 5
+#define LUA_YIELD 1
+#define LUA_ERRRUN 2
+#define LUA_ERRSYNTAX 3
+#define LUA_ERRMEM 4
+#define LUA_ERRERR 5
typedef struct lua_State lua_State;
@@ -69,22 +69,22 @@
/*
** basic types
*/
-#define LUA_TNONE (-1)
+#define LUA_TNONE (-1)
-#define LUA_TNIL 0
-#define LUA_TBOOLEAN 1
-#define LUA_TLIGHTUSERDATA 2
-#define LUA_TNUMBER 3
-#define LUA_TSTRING 4
-#define LUA_TTABLE 5
-#define LUA_TFUNCTION 6
-#define LUA_TUSERDATA 7
-#define LUA_TTHREAD 8
+#define LUA_TNIL 0
+#define LUA_TBOOLEAN 1
+#define LUA_TLIGHTUSERDATA 2
+#define LUA_TNUMBER 3
+#define LUA_TSTRING 4
+#define LUA_TTABLE 5
+#define LUA_TFUNCTION 6
+#define LUA_TUSERDATA 7
+#define LUA_TTHREAD 8
/* minimum Lua stack available to a C function */
-#define LUA_MINSTACK 20
+#define LUA_MINSTACK 20
/*
@@ -149,7 +149,7 @@
LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
LUA_API size_t (lua_objlen) (lua_State *L, int idx);
LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
-LUA_API void *(lua_touserdata) (lua_State *L, int idx);
+LUA_API void *(lua_touserdata) (lua_State *L, int idx);
LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
LUA_API const void *(lua_topointer) (lua_State *L, int idx);
@@ -218,14 +218,14 @@
** garbage-collection function and options
*/
-#define LUA_GCSTOP 0
-#define LUA_GCRESTART 1
-#define LUA_GCCOLLECT 2
-#define LUA_GCCOUNT 3
-#define LUA_GCCOUNTB 4
-#define LUA_GCSTEP 5
-#define LUA_GCSETPAUSE 6
-#define LUA_GCSETSTEPMUL 7
+#define LUA_GCSTOP 0
+#define LUA_GCRESTART 1
+#define LUA_GCCOLLECT 2
+#define LUA_GCCOUNT 3
+#define LUA_GCCOUNTB 4
+#define LUA_GCSTEP 5
+#define LUA_GCSETPAUSE 6
+#define LUA_GCSETSTEPMUL 7
LUA_API int (lua_gc) (lua_State *L, int what, int data);
@@ -251,32 +251,32 @@
** ===============================================================
*/
-#define lua_pop(L,n) lua_settop(L, -(n)-1)
+#define lua_pop(L,n) lua_settop(L, -(n)-1)
-#define lua_newtable(L) lua_createtable(L, 0, 0)
+#define lua_newtable(L) lua_createtable(L, 0, 0)
#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
-#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
+#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
-#define lua_strlen(L,i) lua_objlen(L, (i))
+#define lua_strlen(L,i) lua_objlen(L, (i))
-#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
-#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
-#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
-#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
-#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
-#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
-#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
-#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
+#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
+#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
+#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
+#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
+#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
+#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
+#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
+#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
-#define lua_pushliteral(L, s) \
- lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
+#define lua_pushliteral(L, s) \
+ lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
-#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s))
-#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s))
+#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s))
+#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s))
-#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
+#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
@@ -284,18 +284,18 @@
** compatibility macros and functions
*/
-#define lua_open() luaL_newstate()
+#define lua_open() luaL_newstate()
-#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)
+#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)
-#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0)
+#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0)
-#define lua_Chunkreader lua_Reader
-#define lua_Chunkwriter lua_Writer
+#define lua_Chunkreader lua_Reader
+#define lua_Chunkwriter lua_Writer
/* hack */
-LUA_API void lua_setlevel (lua_State *from, lua_State *to);
+LUA_API void lua_setlevel (lua_State *from, lua_State *to);
/*
@@ -308,20 +308,20 @@
/*
** Event codes
*/
-#define LUA_HOOKCALL 0
-#define LUA_HOOKRET 1
-#define LUA_HOOKLINE 2
-#define LUA_HOOKCOUNT 3
+#define LUA_HOOKCALL 0
+#define LUA_HOOKRET 1
+#define LUA_HOOKLINE 2
+#define LUA_HOOKCOUNT 3
#define LUA_HOOKTAILRET 4
/*
** Event masks
*/
-#define LUA_MASKCALL (1 << LUA_HOOKCALL)
-#define LUA_MASKRET (1 << LUA_HOOKRET)
-#define LUA_MASKLINE (1 << LUA_HOOKLINE)
-#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
+#define LUA_MASKCALL (1 << LUA_HOOKCALL)
+#define LUA_MASKRET (1 << LUA_HOOKRET)
+#define LUA_MASKLINE (1 << LUA_HOOKLINE)
+#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
typedef struct lua_Debug lua_Debug; /* activation record */
@@ -345,14 +345,14 @@
struct lua_Debug {
int event;
- const char *name; /* (n) */
- const char *namewhat; /* (n) `global', `local', `field', `method' */
- const char *what; /* (S) `Lua', `C', `main', `tail' */
- const char *source; /* (S) */
- int currentline; /* (l) */
- int nups; /* (u) number of upvalues */
- int linedefined; /* (S) */
- int lastlinedefined; /* (S) */
+ const char *name; /* (n) */
+ const char *namewhat; /* (n) `global', `local', `field', `method' */
+ const char *what; /* (S) `Lua', `C', `main', `tail' */
+ const char *source; /* (S) */
+ int currentline; /* (l) */
+ int nups; /* (u) number of upvalues */
+ int linedefined; /* (S) */
+ int lastlinedefined; /* (S) */
char short_src[LUA_IDSIZE]; /* (S) */
/* private part */
int i_ci; /* active function */
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/luaconf.h
--- a/misc/liblua/luaconf.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/luaconf.h Tue Jan 21 22:43:06 2014 +0100
@@ -35,13 +35,13 @@
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
-#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
-#define LUA_USE_READLINE /* needs some extra libraries */
+#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
+#define LUA_USE_READLINE /* needs some extra libraries */
#endif
#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
-#define LUA_DL_DYLD /* does not need extra library */
+#define LUA_DL_DYLD /* does not need extra library */
#endif
@@ -68,7 +68,7 @@
*/
#define LUA_PATH "LUA_PATH"
#define LUA_CPATH "LUA_CPATH"
-#define LUA_INIT "LUA_INIT"
+#define LUA_INIT "LUA_INIT"
/*
@@ -85,23 +85,23 @@
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
-#define LUA_LDIR "!\\lua\\"
-#define LUA_CDIR "!\\"
+#define LUA_LDIR "!\\lua\\"
+#define LUA_CDIR "!\\"
#define LUA_PATH_DEFAULT \
- ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
- LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua"
+ ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
+ LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua"
#define LUA_CPATH_DEFAULT \
- ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
+ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
-#define LUA_ROOT "/usr/local/"
-#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
-#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
+#define LUA_ROOT "/usr/local/"
+#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
+#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
#define LUA_PATH_DEFAULT \
- "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
+ "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
#define LUA_CPATH_DEFAULT \
- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
+ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
#endif
@@ -111,9 +111,9 @@
** and is not Windows. (On Windows Lua automatically uses "\".)
*/
#if defined(_WIN32)
-#define LUA_DIRSEP "\\"
+#define LUA_DIRSEP "\\"
#else
-#define LUA_DIRSEP "/"
+#define LUA_DIRSEP "/"
#endif
@@ -129,10 +129,10 @@
** characters. (E.g., if one of those characters is a common character
** in file/directory names.) Probably you do not need to change them.
*/
-#define LUA_PATHSEP ";"
-#define LUA_PATH_MARK "?"
-#define LUA_EXECDIR "!"
-#define LUA_IGMARK "-"
+#define LUA_PATHSEP ";"
+#define LUA_PATH_MARK "?"
+#define LUA_EXECDIR "!"
+#define LUA_IGMARK "-"
/*
@@ -140,7 +140,7 @@
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
-#define LUA_INTEGER ptrdiff_t
+#define LUA_INTEGER ptrdiff_t
/*
@@ -161,12 +161,12 @@
#else
-#define LUA_API extern
+#define LUA_API extern
#endif
/* more often than not the libs go together with the core */
-#define LUALIB_API LUA_API
+#define LUALIB_API LUA_API
/*
@@ -179,17 +179,17 @@
** when Lua is compiled as a shared library.
*/
#if defined(luaall_c)
-#define LUAI_FUNC static
-#define LUAI_DATA /* empty */
+#define LUAI_FUNC static
+#define LUAI_DATA /* empty */
#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
defined(__ELF__)
-#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
-#define LUAI_DATA LUAI_FUNC
+#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
+#define LUAI_DATA LUAI_FUNC
#else
-#define LUAI_FUNC extern
-#define LUAI_DATA extern
+#define LUAI_FUNC extern
+#define LUAI_DATA extern
#endif
@@ -198,8 +198,8 @@
@@ LUA_QL describes how error messages quote program elements.
** CHANGE it if you want a different appearance.
*/
-#define LUA_QL(x) "'" x "'"
-#define LUA_QS LUA_QL("%s")
+#define LUA_QL(x) "'" x "'"
+#define LUA_QS LUA_QL("%s")
/*
@@ -207,7 +207,7 @@
@* of a function in debug information.
** CHANGE it if you want a different size.
*/
-#define LUA_IDSIZE 60
+#define LUA_IDSIZE 60
/*
@@ -226,13 +226,13 @@
*/
#if defined(LUA_USE_ISATTY)
#include
-#define lua_stdin_is_tty() isatty(0)
+#define lua_stdin_is_tty() isatty(0)
#elif defined(LUA_WIN)
#include
#include
-#define lua_stdin_is_tty() _isatty(_fileno(stdin))
+#define lua_stdin_is_tty() _isatty(_fileno(stdin))
#else
-#define lua_stdin_is_tty() 1 /* assume stdin is a tty */
+#define lua_stdin_is_tty() 1 /* assume stdin is a tty */
#endif
@@ -242,8 +242,8 @@
** CHANGE them if you want different prompts. (You can also change the
** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
*/
-#define LUA_PROMPT "> "
-#define LUA_PROMPT2 ">> "
+#define LUA_PROMPT "> "
+#define LUA_PROMPT2 ">> "
/*
@@ -251,7 +251,7 @@
** CHANGE it if your stand-alone interpreter has a different name and
** your system is not able to detect that name automatically.
*/
-#define LUA_PROGNAME "lua"
+#define LUA_PROGNAME "lua"
/*
@@ -259,7 +259,7 @@
@* stand-alone interpreter.
** CHANGE it if you need longer lines.
*/
-#define LUA_MAXINPUT 512
+#define LUA_MAXINPUT 512
/*
@@ -274,17 +274,17 @@
#include
#include
#include
-#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL)
+#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL)
#define lua_saveline(L,idx) \
- if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
- add_history(lua_tostring(L, idx)); /* add it to history */
-#define lua_freeline(L,b) ((void)L, free(b))
+ if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
+ add_history(lua_tostring(L, idx)); /* add it to history */
+#define lua_freeline(L,b) ((void)L, free(b))
#else
-#define lua_readline(L,b,p) \
- ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \
- fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */
-#define lua_saveline(L,idx) { (void)L; (void)idx; }
-#define lua_freeline(L,b) { (void)L; (void)b; }
+#define lua_readline(L,b,p) \
+ ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \
+ fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */
+#define lua_saveline(L,idx) { (void)L; (void)idx; }
+#define lua_freeline(L,b) { (void)L; (void)b; }
#endif
#endif
@@ -299,7 +299,7 @@
** mean larger pauses which mean slower collection.) You can also change
** this value dynamically.
*/
-#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */
+#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */
/*
@@ -310,7 +310,7 @@
** infinity, where each step performs a full collection.) You can also
** change this value dynamically.
*/
-#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */
+#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */
@@ -348,7 +348,7 @@
** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
** off the advisory error when nesting [[...]].
*/
-#define LUA_COMPAT_LSTR 1
+#define LUA_COMPAT_LSTR 1
/*
@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
@@ -376,9 +376,9 @@
*/
#if defined(LUA_USE_APICHECK)
#include
-#define luai_apicheck(L,o) { (void)L; assert(o); }
+#define luai_apicheck(L,o) { (void)L; assert(o); }
#else
-#define luai_apicheck(L,o) { (void)L; }
+#define luai_apicheck(L,o) { (void)L; }
#endif
@@ -389,10 +389,10 @@
*/
/* avoid overflows in comparison */
#if INT_MAX-20 < 32760
-#define LUAI_BITSINT 16
+#define LUAI_BITSINT 16
#elif INT_MAX > 2147483640L
/* int has at least 32 bits */
-#define LUAI_BITSINT 32
+#define LUAI_BITSINT 32
#else
#error "you must define LUA_BITSINT with number of bits in an integer"
#endif
@@ -411,18 +411,18 @@
** longs.) Probably you do not need to change this.
*/
#if LUAI_BITSINT >= 32
-#define LUAI_UINT32 unsigned int
-#define LUAI_INT32 int
-#define LUAI_MAXINT32 INT_MAX
-#define LUAI_UMEM size_t
-#define LUAI_MEM ptrdiff_t
+#define LUAI_UINT32 unsigned int
+#define LUAI_INT32 int
+#define LUAI_MAXINT32 INT_MAX
+#define LUAI_UMEM size_t
+#define LUAI_MEM ptrdiff_t
#else
/* 16-bit ints */
-#define LUAI_UINT32 unsigned long
-#define LUAI_INT32 long
-#define LUAI_MAXINT32 LONG_MAX
-#define LUAI_UMEM unsigned long
-#define LUAI_MEM long
+#define LUAI_UINT32 unsigned long
+#define LUAI_INT32 long
+#define LUAI_MAXINT32 LONG_MAX
+#define LUAI_UMEM unsigned long
+#define LUAI_MEM long
#endif
@@ -432,7 +432,7 @@
** arbitrary; its only purpose is to stop infinite recursion before
** exhausting memory.
*/
-#define LUAI_MAXCALLS 20000
+#define LUAI_MAXCALLS 20000
/*
@@ -443,7 +443,7 @@
** functions to consume unlimited stack space. (must be smaller than
** -LUA_REGISTRYINDEX)
*/
-#define LUAI_MAXCSTACK 8000
+#define LUAI_MAXCSTACK 8000
@@ -465,27 +465,27 @@
@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
@* syntactical nested non-terminals in a program.
*/
-#define LUAI_MAXCCALLS 200
+#define LUAI_MAXCCALLS 200
/*
@@ LUAI_MAXVARS is the maximum number of local variables per function
@* (must be smaller than 250).
*/
-#define LUAI_MAXVARS 200
+#define LUAI_MAXVARS 200
/*
@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function
@* (must be smaller than 250).
*/
-#define LUAI_MAXUPVALUES 60
+#define LUAI_MAXUPVALUES 60
/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
*/
-#define LUAL_BUFFERSIZE BUFSIZ
+#define LUAL_BUFFERSIZE BUFSIZ
/* }================================================================== */
@@ -502,13 +502,13 @@
*/
#define LUA_NUMBER_DOUBLE
-#define LUA_NUMBER double
+#define LUA_NUMBER double
/*
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@* over a number.
*/
-#define LUAI_UACNUMBER double
+#define LUAI_UACNUMBER double
/*
@@ -518,11 +518,11 @@
@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
@@ lua_str2number converts a string to a number.
*/
-#define LUA_NUMBER_SCAN "%lf"
-#define LUA_NUMBER_FMT "%.14g"
-#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
-#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
-#define lua_str2number(s,p) strtod((s), (p))
+#define LUA_NUMBER_SCAN "%lf"
+#define LUA_NUMBER_FMT "%.14g"
+#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
+#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
+#define lua_str2number(s,p) strtod((s), (p))
/*
@@ -530,17 +530,17 @@
*/
#if defined(LUA_CORE)
#include
-#define luai_numadd(a,b) ((a)+(b))
-#define luai_numsub(a,b) ((a)-(b))
-#define luai_nummul(a,b) ((a)*(b))
-#define luai_numdiv(a,b) ((a)/(b))
-#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b))
-#define luai_numpow(a,b) (pow(a,b))
-#define luai_numunm(a) (-(a))
-#define luai_numeq(a,b) ((a)==(b))
-#define luai_numlt(a,b) ((a)<(b))
-#define luai_numle(a,b) ((a)<=(b))
-#define luai_numisnan(a) (!luai_numeq((a), (a)))
+#define luai_numadd(a,b) ((a)+(b))
+#define luai_numsub(a,b) ((a)-(b))
+#define luai_nummul(a,b) ((a)*(b))
+#define luai_numdiv(a,b) ((a)/(b))
+#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b))
+#define luai_numpow(a,b) (pow(a,b))
+#define luai_numunm(a) (-(a))
+#define luai_numeq(a,b) ((a)==(b))
+#define luai_numlt(a,b) ((a)<(b))
+#define luai_numle(a,b) ((a)<=(b))
+#define luai_numisnan(a) (!luai_numeq((a), (a)))
#endif
@@ -561,7 +561,7 @@
#if defined(_MSC_VER)
#define lua_number2int(i,d) __asm fld d __asm fistp i
-#define lua_number2integer(i,n) lua_number2int(i, n)
+#define lua_number2integer(i,n) lua_number2int(i, n)
/* the next trick should work on any Pentium, but sometimes clashes
with a DirectX idiosyncrasy */
@@ -570,15 +570,15 @@
union luai_Cast { double l_d; long l_l; };
#define lua_number2int(i,d) \
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
-#define lua_number2integer(i,n) lua_number2int(i, n)
+#define lua_number2integer(i,n) lua_number2int(i, n)
#endif
/* this option always works, but may be slow */
#else
-#define lua_number2int(i,d) ((i)=(int)(d))
-#define lua_number2integer(i,d) ((i)=(lua_Integer)(d))
+#define lua_number2int(i,d) ((i)=(int)(d))
+#define lua_number2integer(i,d) ((i)=(lua_Integer)(d))
#endif
@@ -592,7 +592,7 @@
** aligned in 16-byte boundaries, then you should add long double in the
** union.) Probably you do not need to change this.
*/
-#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
+#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
/*
@@ -605,22 +605,22 @@
*/
#if defined(__cplusplus)
/* C++ exceptions */
-#define LUAI_THROW(L,c) throw(c)
-#define LUAI_TRY(L,c,a) try { a } catch(...) \
- { if ((c)->status == 0) (c)->status = -1; }
-#define luai_jmpbuf int /* dummy variable */
+#define LUAI_THROW(L,c) throw(c)
+#define LUAI_TRY(L,c,a) try { a } catch(...) \
+ { if ((c)->status == 0) (c)->status = -1; }
+#define luai_jmpbuf int /* dummy variable */
#elif defined(LUA_USE_ULONGJMP)
/* in Unix, try _longjmp/_setjmp (more efficient) */
-#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
-#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
-#define luai_jmpbuf jmp_buf
+#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
+#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
+#define luai_jmpbuf jmp_buf
#else
/* default handling with long jumps */
-#define LUAI_THROW(L,c) longjmp((c)->b, 1)
-#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
-#define luai_jmpbuf jmp_buf
+#define LUAI_THROW(L,c) longjmp((c)->b, 1)
+#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
+#define luai_jmpbuf jmp_buf
#endif
@@ -630,7 +630,7 @@
@* can do during pattern-matching.
** CHANGE it if you need more captures. This limit is arbitrary.
*/
-#define LUA_MAXCAPTURES 32
+#define LUA_MAXCAPTURES 32
/*
@@ -645,16 +645,16 @@
#if defined(LUA_USE_MKSTEMP)
#include
-#define LUA_TMPNAMBUFSIZE 32
-#define lua_tmpnam(b,e) { \
- strcpy(b, "/tmp/lua_XXXXXX"); \
- e = mkstemp(b); \
- if (e != -1) close(e); \
- e = (e == -1); }
+#define LUA_TMPNAMBUFSIZE 32
+#define lua_tmpnam(b,e) { \
+ strcpy(b, "/tmp/lua_XXXXXX"); \
+ e = mkstemp(b); \
+ if (e != -1) close(e); \
+ e = (e == -1); }
#else
-#define LUA_TMPNAMBUFSIZE L_tmpnam
-#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); }
+#define LUA_TMPNAMBUFSIZE L_tmpnam
+#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); }
#endif
#endif
@@ -667,19 +667,19 @@
*/
#if defined(LUA_USE_POPEN)
-#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
-#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
+#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
+#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
#elif defined(LUA_WIN)
-#define lua_popen(L,c,m) ((void)L, _popen(c,m))
-#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1))
+#define lua_popen(L,c,m) ((void)L, _popen(c,m))
+#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1))
#else
-#define lua_popen(L,c,m) ((void)((void)c, m), \
- luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
-#define lua_pclose(L,file) ((void)((void)L, file), 0)
+#define lua_popen(L,c,m) ((void)((void)c, m), \
+ luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
+#define lua_pclose(L,file) ((void)((void)L, file), 0)
#endif
@@ -712,7 +712,7 @@
** CHANGE (define) this if you really need that. This value must be
** a multiple of the maximum alignment required for your machine.
*/
-#define LUAI_EXTRASPACE 0
+#define LUAI_EXTRASPACE 0
/*
@@ -720,12 +720,12 @@
** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
** extra when a thread is created/deleted/resumed/yielded.
*/
-#define luai_userstateopen(L) ((void)L)
-#define luai_userstateclose(L) ((void)L)
-#define luai_userstatethread(L,L1) ((void)L)
-#define luai_userstatefree(L) ((void)L)
-#define luai_userstateresume(L,n) ((void)L)
-#define luai_userstateyield(L,n) ((void)L)
+#define luai_userstateopen(L) ((void)L)
+#define luai_userstateclose(L) ((void)L)
+#define luai_userstatethread(L,L1) ((void)L)
+#define luai_userstatefree(L) ((void)L)
+#define luai_userstateresume(L,n) ((void)L)
+#define luai_userstateyield(L,n) ((void)L)
/*
@@ -738,13 +738,13 @@
#if defined(LUA_USELONGLONG)
-#define LUA_INTFRMLEN "ll"
-#define LUA_INTFRM_T long long
+#define LUA_INTFRMLEN "ll"
+#define LUA_INTFRM_T long long
#else
-#define LUA_INTFRMLEN "l"
-#define LUA_INTFRM_T long
+#define LUA_INTFRMLEN "l"
+#define LUA_INTFRM_T long
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lualib.h
--- a/misc/liblua/lualib.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lualib.h Tue Jan 21 22:43:06 2014 +0100
@@ -12,31 +12,31 @@
/* Key to file-handle type */
-#define LUA_FILEHANDLE "FILE*"
+#define LUA_FILEHANDLE "FILE*"
-#define LUA_COLIBNAME "coroutine"
+#define LUA_COLIBNAME "coroutine"
LUALIB_API int (luaopen_base) (lua_State *L);
-#define LUA_TABLIBNAME "table"
+#define LUA_TABLIBNAME "table"
LUALIB_API int (luaopen_table) (lua_State *L);
-#define LUA_IOLIBNAME "io"
+#define LUA_IOLIBNAME "io"
LUALIB_API int (luaopen_io) (lua_State *L);
-#define LUA_OSLIBNAME "os"
+#define LUA_OSLIBNAME "os"
LUALIB_API int (luaopen_os) (lua_State *L);
-#define LUA_STRLIBNAME "string"
+#define LUA_STRLIBNAME "string"
LUALIB_API int (luaopen_string) (lua_State *L);
-#define LUA_MATHLIBNAME "math"
+#define LUA_MATHLIBNAME "math"
LUALIB_API int (luaopen_math) (lua_State *L);
-#define LUA_DBLIBNAME "debug"
+#define LUA_DBLIBNAME "debug"
LUALIB_API int (luaopen_debug) (lua_State *L);
-#define LUA_LOADLIBNAME "package"
+#define LUA_LOADLIBNAME "package"
LUALIB_API int (luaopen_package) (lua_State *L);
@@ -46,7 +46,7 @@
#ifndef lua_assert
-#define lua_assert(x) ((void)0)
+#define lua_assert(x) ((void)0)
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lundump.c
--- a/misc/liblua/lundump.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lundump.c Tue Jan 21 22:43:06 2014 +0100
@@ -31,7 +31,7 @@
#define IF(c,s)
#define error(S,s)
#else
-#define IF(c,s) if (c) error(S,s)
+#define IF(c,s) if (c) error(S,s)
static void error(LoadState* S, const char* why)
{
@@ -40,10 +40,10 @@
}
#endif
-#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size))
-#define LoadByte(S) (lu_byte)LoadChar(S)
-#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x))
-#define LoadVector(S,b,n,size) LoadMem(S,b,n,size)
+#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size))
+#define LoadByte(S) (lu_byte)LoadChar(S)
+#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x))
+#define LoadVector(S,b,n,size) LoadMem(S,b,n,size)
static void LoadBlock(LoadState* S, void* b, size_t size)
{
@@ -83,7 +83,7 @@
{
char* s=luaZ_openspace(S->L,S->b,size);
LoadBlock(S,s,size);
- return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
+ return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */
}
}
@@ -111,20 +111,20 @@
switch (t)
{
case LUA_TNIL:
- setnilvalue(o);
- break;
+ setnilvalue(o);
+ break;
case LUA_TBOOLEAN:
- setbvalue(o,LoadChar(S)!=0);
- break;
+ setbvalue(o,LoadChar(S)!=0);
+ break;
case LUA_TNUMBER:
- setnvalue(o,LoadNumber(S));
- break;
+ setnvalue(o,LoadNumber(S));
+ break;
case LUA_TSTRING:
- setsvalue2n(S->L,o,LoadString(S));
- break;
+ setsvalue2n(S->L,o,LoadString(S));
+ break;
default:
- error(S,"bad constant");
- break;
+ error(S,"bad constant");
+ break;
}
}
n=LoadInt(S);
@@ -218,10 +218,10 @@
h+=sizeof(LUA_SIGNATURE)-1;
*h++=(char)LUAC_VERSION;
*h++=(char)LUAC_FORMAT;
- *h++=(char)*(char*)&x; /* endianness */
+ *h++=(char)*(char*)&x; /* endianness */
*h++=(char)sizeof(int);
*h++=(char)sizeof(size_t);
*h++=(char)sizeof(Instruction);
*h++=(char)sizeof(lua_Number);
- *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */
+ *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */
}
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lundump.h
--- a/misc/liblua/lundump.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lundump.h Tue Jan 21 22:43:06 2014 +0100
@@ -25,12 +25,12 @@
#endif
/* for header of binary files -- this is Lua 5.1 */
-#define LUAC_VERSION 0x51
+#define LUAC_VERSION 0x51
/* for header of binary files -- this is the official format */
-#define LUAC_FORMAT 0
+#define LUAC_FORMAT 0
/* size of header of binary files */
-#define LUAC_HEADERSIZE 12
+#define LUAC_HEADERSIZE 12
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lvm.c
--- a/misc/liblua/lvm.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lvm.c Tue Jan 21 22:43:06 2014 +0100
@@ -29,7 +29,7 @@
/* limit for table tag-method chains (to avoid loops) */
-#define MAXTAGLOOP 100
+#define MAXTAGLOOP 100
const TValue *luaV_tonumber (const TValue *obj, TValue *n) {
@@ -338,23 +338,23 @@
** some macros for common tasks in `luaV_execute'
*/
-#define runtime_check(L, c) { if (!(c)) break; }
+#define runtime_check(L, c) { if (!(c)) break; }
-#define RA(i) (base+GETARG_A(i))
+#define RA(i) (base+GETARG_A(i))
/* to be used after possible stack reallocation */
-#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))
-#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))
-#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \
- ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))
-#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \
- ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))
-#define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i))
+#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))
+#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))
+#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \
+ ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))
+#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \
+ ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))
+#define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i))
-#define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);}
+#define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);}
-#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; }
+#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; }
#define arith_op(op,tm) { \
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lvm.h
--- a/misc/liblua/lvm.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lvm.h Tue Jan 21 22:43:06 2014 +0100
@@ -15,11 +15,11 @@
#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
-#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \
+#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \
(((o) = luaV_tonumber(o,n)) != NULL))
#define equalobj(L,o1,o2) \
- (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
+ (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/lzio.h
--- a/misc/liblua/lzio.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/lzio.h Tue Jan 21 22:43:06 2014 +0100
@@ -13,11 +13,11 @@
#include "lmem.h"
-#define EOZ (-1) /* end of stream */
+#define EOZ (-1) /* end of stream */
typedef struct Zio ZIO;
-#define char2int(c) cast(int, cast(unsigned char, (c)))
+#define char2int(c) cast(int, cast(unsigned char, (c)))
#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
@@ -29,24 +29,24 @@
#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
-#define luaZ_buffer(buff) ((buff)->buffer)
-#define luaZ_sizebuffer(buff) ((buff)->buffsize)
-#define luaZ_bufflen(buff) ((buff)->n)
+#define luaZ_buffer(buff) ((buff)->buffer)
+#define luaZ_sizebuffer(buff) ((buff)->buffsize)
+#define luaZ_bufflen(buff) ((buff)->n)
#define luaZ_resetbuffer(buff) ((buff)->n = 0)
#define luaZ_resizebuffer(L, buff, size) \
- (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
- (buff)->buffsize = size)
+ (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
+ (buff)->buffsize = size)
-#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
+#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
void *data);
-LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
+LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
LUAI_FUNC int luaZ_lookahead (ZIO *z);
@@ -54,11 +54,11 @@
/* --------- Private Part ------------------ */
struct Zio {
- size_t n; /* bytes still unread */
- const char *p; /* current position in buffer */
+ size_t n; /* bytes still unread */
+ const char *p; /* current position in buffer */
lua_Reader reader;
- void* data; /* additional data */
- lua_State *L; /* Lua state (for reader) */
+ void* data; /* additional data */
+ lua_State *L; /* Lua state (for reader) */
};
diff -r 4feced261c68 -r de822cd3df3a misc/liblua/print.c
--- a/misc/liblua/print.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/liblua/print.c Tue Jan 21 22:43:06 2014 +0100
@@ -15,10 +15,10 @@
#include "lopcodes.h"
#include "lundump.h"
-#define PrintFunction luaU_print
+#define PrintFunction luaU_print
-#define Sizeof(x) ((int)sizeof(x))
-#define VOID(p) ((const void*)(p))
+#define Sizeof(x) ((int)sizeof(x))
+#define VOID(p) ((const void*)(p))
static void PrintString(const TString* ts)
{
@@ -39,10 +39,10 @@
case '\r': printf("\\r"); break;
case '\t': printf("\\t"); break;
case '\v': printf("\\v"); break;
- default: if (isprint((unsigned char)c))
- putchar(c);
- else
- printf("\\%03u",(unsigned char)c);
+ default: if (isprint((unsigned char)c))
+ putchar(c);
+ else
+ printf("\\%03u",(unsigned char)c);
}
}
putchar('"');
@@ -54,20 +54,20 @@
switch (ttype(o))
{
case LUA_TNIL:
- printf("nil");
- break;
+ printf("nil");
+ break;
case LUA_TBOOLEAN:
- printf(bvalue(o) ? "true" : "false");
- break;
+ printf(bvalue(o) ? "true" : "false");
+ break;
case LUA_TNUMBER:
- printf(LUA_NUMBER_FMT,nvalue(o));
- break;
+ printf(LUA_NUMBER_FMT,nvalue(o));
+ break;
case LUA_TSTRING:
- PrintString(rawtsvalue(o));
- break;
- default: /* cannot happen */
- printf("? type=%d",ttype(o));
- break;
+ PrintString(rawtsvalue(o));
+ break;
+ default: /* cannot happen */
+ printf("? type=%d",ttype(o));
+ break;
}
}
@@ -155,8 +155,8 @@
}
}
-#define SS(x) (x==1)?"":"s"
-#define S(x) x,SS(x)
+#define SS(x) (x==1)?"":"s"
+#define S(x) x,SS(x)
static void PrintHeader(const Proto* f)
{
@@ -168,14 +168,14 @@
else
s="(string)";
printf("\n%s <%s:%d,%d> (%d instruction%s, %d bytes at %p)\n",
- (f->linedefined==0)?"main":"function",s,
- f->linedefined,f->lastlinedefined,
- S(f->sizecode),f->sizecode*Sizeof(Instruction),VOID(f));
+ (f->linedefined==0)?"main":"function",s,
+ f->linedefined,f->lastlinedefined,
+ S(f->sizecode),f->sizecode*Sizeof(Instruction),VOID(f));
printf("%d%s param%s, %d slot%s, %d upvalue%s, ",
- f->numparams,f->is_vararg?"+":"",SS(f->numparams),
- S(f->maxstacksize),S(f->nups));
+ f->numparams,f->is_vararg?"+":"",SS(f->numparams),
+ S(f->maxstacksize),S(f->nups));
printf("%d local%s, %d constant%s, %d function%s\n",
- S(f->sizelocvars),S(f->sizek),S(f->sizep));
+ S(f->sizelocvars),S(f->sizek),S(f->sizep));
}
static void PrintConstants(const Proto* f)
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/archiver_unpacked.c
--- a/misc/libphysfs/archiver_unpacked.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/archiver_unpacked.c Tue Jan 21 22:43:06 2014 +0100
@@ -200,7 +200,7 @@
rc = -1;
else if (ch > '/')
rc = 1;
- else
+ else
{
if (stop_on_first_find) /* Just checking dir's existance? */
return middle;
@@ -293,7 +293,7 @@
/*
* This will find the UNPKentry associated with a path in platform-independent
- * notation. Directories don't have UNPKentries associated with them, but
+ * notation. Directories don't have UNPKentries associated with them, but
* (*isDir) will be set to non-zero if a dir was hit.
*/
static UNPKentry *findEntry(const UNPKinfo *info, const char *path, int *isDir)
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/archiver_wad.c
--- a/misc/libphysfs/archiver_wad.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/archiver_wad.c Tue Jan 21 22:43:06 2014 +0100
@@ -1,7 +1,7 @@
/*
* WAD support routines for PhysicsFS.
*
- * This driver handles DOOM engine archives ("wads").
+ * This driver handles DOOM engine archives ("wads").
* This format (but not this driver) was designed by id Software for use
* with the DOOM engine.
* The specs of the format are from the unofficial doom specs v1.666
@@ -28,7 +28,7 @@
* (c) an 8-byte ASCII string, the name of the lump, padded with zeros.
* For example, the "DEMO1" entry in hexadecimal would be
* (44 45 4D 4F 31 00 00 00)
- *
+ *
* Note that there is no way to tell if an opened WAD archive is a
* IWAD or PWAD with this archiver.
* I couldn't think of a way to provide that information, without being too
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/archiver_zip.c
--- a/misc/libphysfs/archiver_zip.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/archiver_zip.c Tue Jan 21 22:43:06 2014 +0100
@@ -488,7 +488,7 @@
(buf[i + 3] == 0x06) )
{
found = 1; /* that's the signature! */
- break;
+ break;
} /* if */
} /* for */
@@ -552,7 +552,7 @@
/*
* This will find the ZIPentry associated with a path in platform-independent
- * notation. Directories don't have ZIPentries associated with them, but
+ * notation. Directories don't have ZIPentries associated with them, but
* (*isDir) will be set to non-zero if a dir was hit.
*/
static ZIPentry *zip_find_entry(const ZIPinfo *info, const char *path,
@@ -724,7 +724,7 @@
path = (char *) __PHYSFS_smallAlloc(size + 1);
BAIL_IF_MACRO(!path, PHYSFS_ERR_OUT_OF_MEMORY, 0);
-
+
if (entry->compression_method == COMPMETH_NONE)
rc = __PHYSFS_readAll(io, path, size);
@@ -1445,7 +1445,7 @@
rc = -1;
else if ('/' > ch)
rc = 1;
- else
+ else
{
if (stop_on_first_find) /* Just checking dir's existance? */
return middle;
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/physfs.c
--- a/misc/libphysfs/physfs.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/physfs.c Tue Jan 21 22:43:06 2014 +0100
@@ -486,7 +486,7 @@
memcpy(retval, io, sizeof (PHYSFS_Io));
retval->opaque = newfh;
return retval;
-
+
handleIo_dupe_failed:
if (newfh)
{
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/physfs.h
--- a/misc/libphysfs/physfs.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/physfs.h Tue Jan 21 22:43:06 2014 +0100
@@ -128,9 +128,9 @@
*
* PhysicsFS is mostly thread safe. The error messages returned by
* PHYSFS_getLastError() are unique by thread, and library-state-setting
- * functions are mutex'd. For efficiency, individual file accesses are
- * not locked, so you can not safely read/write/seek/close/etc the same
- * file from two threads at the same time. Other race conditions are bugs
+ * functions are mutex'd. For efficiency, individual file accesses are
+ * not locked, so you can not safely read/write/seek/close/etc the same
+ * file from two threads at the same time. Other race conditions are bugs
* that should be reported/patched.
*
* While you CAN use stdio/syscall file access in a program that has PHYSFS_*
@@ -2604,10 +2604,10 @@
*/
typedef enum PHYSFS_FileType
{
- PHYSFS_FILETYPE_REGULAR, /**< a normal file */
- PHYSFS_FILETYPE_DIRECTORY, /**< a directory */
- PHYSFS_FILETYPE_SYMLINK, /**< a symlink */
- PHYSFS_FILETYPE_OTHER /**< something completely different like a device */
+ PHYSFS_FILETYPE_REGULAR, /**< a normal file */
+ PHYSFS_FILETYPE_DIRECTORY, /**< a directory */
+ PHYSFS_FILETYPE_SYMLINK, /**< a symlink */
+ PHYSFS_FILETYPE_OTHER /**< something completely different like a device */
} PHYSFS_FileType;
/**
@@ -2628,12 +2628,12 @@
*/
typedef struct PHYSFS_Stat
{
- PHYSFS_sint64 filesize; /**< size in bytes, -1 for non-files and unknown */
- PHYSFS_sint64 modtime; /**< last modification time */
- PHYSFS_sint64 createtime; /**< like modtime, but for file creation time */
- PHYSFS_sint64 accesstime; /**< like modtime, but for file access time */
- PHYSFS_FileType filetype; /**< File? Directory? Symlink? */
- int readonly; /**< non-zero if read only, zero if writable. */
+ PHYSFS_sint64 filesize; /**< size in bytes, -1 for non-files and unknown */
+ PHYSFS_sint64 modtime; /**< last modification time */
+ PHYSFS_sint64 createtime; /**< like modtime, but for file creation time */
+ PHYSFS_sint64 accesstime; /**< like modtime, but for file access time */
+ PHYSFS_FileType filetype; /**< File? Directory? Symlink? */
+ int readonly; /**< non-zero if read only, zero if writable. */
} PHYSFS_Stat;
/**
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/physfs_internal.h
--- a/misc/libphysfs/physfs_internal.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/physfs_internal.h Tue Jan 21 22:43:06 2014 +0100
@@ -726,12 +726,12 @@
/*
* Grab possession of a platform-specific mutex. Mutexes should be recursive;
* that is, the same thread should be able to call this function multiple
- * times in a row without causing a deadlock. This function should block
+ * times in a row without causing a deadlock. This function should block
* until a thread can gain possession of the mutex.
*
- * Return non-zero if the mutex was grabbed, zero if there was an
- * unrecoverable problem grabbing it (this should not be a matter of
- * timing out! We're talking major system errors; block until the mutex
+ * Return non-zero if the mutex was grabbed, zero if there was an
+ * unrecoverable problem grabbing it (this should not be a matter of
+ * timing out! We're talking major system errors; block until the mutex
* is available otherwise.)
*
* _DO NOT_ call __PHYSFS_setError() in here! Since setError calls this
@@ -741,7 +741,7 @@
int __PHYSFS_platformGrabMutex(void *mutex);
/*
- * Relinquish possession of the mutex when this method has been called
+ * Relinquish possession of the mutex when this method has been called
* once for each time that platformGrabMutex was called. Once possession has
* been released, the next thread in line to grab the mutex (if any) may
* proceed.
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/physfs_miniz.h
--- a/misc/libphysfs/physfs_miniz.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/physfs_miniz.h Tue Jan 21 22:43:06 2014 +0100
@@ -12,7 +12,7 @@
typedef PHYSFS_sint16 mz_int16;
typedef PHYSFS_uint16 mz_uint16;
typedef PHYSFS_uint32 mz_uint32;
-typedef unsigned int mz_uint;
+typedef unsigned int mz_uint;
typedef PHYSFS_uint64 mz_uint64;
/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. */
@@ -670,7 +670,7 @@
#endif /* #ifndef TINFL_HEADER_FILE_ONLY */
-/*
+/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/platform_macosx.c
--- a/misc/libphysfs/platform_macosx.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/platform_macosx.c Tue Jan 21 22:43:06 2014 +0100
@@ -38,7 +38,7 @@
doesn't work; once a symbol is marked as hidden, it stays that way. */
void __eprintf (const char *string, const char *expression,
- unsigned int line, const char *filename)
+ unsigned int line, const char *filename)
{
fprintf(stderr, string, expression, line, filename);
fflush(stderr);
@@ -144,7 +144,7 @@
if (!IOObjectConformsTo(service, kIOMediaClass))
return 0;
-
+
wholeMedia = IORegistryEntryCreateCFProperty(service,
CFSTR(kIOMediaWholeKey),
cfallocator, 0);
@@ -180,7 +180,7 @@
rc = IORegistryEntryCreateIterator(service, kIOServicePlane,
kIORegistryIterateRecursively | kIORegistryIterateParents, &iter);
-
+
if (!iter)
return 0;
@@ -204,7 +204,7 @@
} /* if */
IOObjectRelease(service);
} while ((service = IOIteratorNext(iter)) && (!retval));
-
+
IOObjectRelease(iter);
IOObjectRelease(service);
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/platform_posix.c
--- a/misc/libphysfs/platform_posix.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/platform_posix.c Tue Jan 21 22:43:06 2014 +0100
@@ -83,7 +83,7 @@
} /* if */
} /* if */
} /* if */
-
+
return retval;
} /* getUserDirByUID */
diff -r 4feced261c68 -r de822cd3df3a misc/libphysfs/platform_windows.c
--- a/misc/libphysfs/platform_windows.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphysfs/platform_windows.c Tue Jan 21 22:43:06 2014 +0100
@@ -171,7 +171,7 @@
stem(SEM_FAILCRITICALERRORS, &oldErrorMode);
else
oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
-
+
/* Do detection. This may block if a disc is spinning up. */
for (i = 'A'; i <= 'Z'; i++)
{
@@ -443,7 +443,7 @@
* psize. Also note that the second parameter can't be
* NULL or the function fails.
*/
- rc = pGetDir(accessToken, &dummy, &psize);
+ rc = pGetDir(accessToken, &dummy, &psize);
assert(!rc); /* !!! FIXME: handle this gracefully. */
(void) rc;
@@ -481,7 +481,7 @@
static int isSymlinkAttrs(const DWORD attr, const DWORD tag)
{
- return ( (attr & FILE_ATTRIBUTE_REPARSE_POINT) &&
+ return ( (attr & FILE_ATTRIBUTE_REPARSE_POINT) &&
(tag == PHYSFS_IO_REPARSE_TAG_SYMLINK) );
} /* isSymlinkAttrs */
@@ -720,7 +720,7 @@
{
BAIL_MACRO(errcodeFromWinApi(), 0);
} /* if */
-
+
return 1; /* No error occured */
} /* __PHYSFS_platformSeek */
diff -r 4feced261c68 -r de822cd3df3a misc/libphyslayer/physfscompat.h
--- a/misc/libphyslayer/physfscompat.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphyslayer/physfscompat.h Tue Jan 21 22:43:06 2014 +0100
@@ -34,20 +34,20 @@
typedef enum PHYSFS_FileType
{
- PHYSFS_FILETYPE_REGULAR,
- PHYSFS_FILETYPE_DIRECTORY,
- PHYSFS_FILETYPE_SYMLINK,
- PHYSFS_FILETYPE_OTHER
+ PHYSFS_FILETYPE_REGULAR,
+ PHYSFS_FILETYPE_DIRECTORY,
+ PHYSFS_FILETYPE_SYMLINK,
+ PHYSFS_FILETYPE_OTHER
} PHYSFS_FileType;
typedef struct PHYSFS_Stat
{
- PHYSFS_sint64 filesize;
- PHYSFS_sint64 modtime;
- PHYSFS_sint64 createtime;
- PHYSFS_sint64 accesstime;
- PHYSFS_FileType filetype;
- int readonly;
+ PHYSFS_sint64 filesize;
+ PHYSFS_sint64 modtime;
+ PHYSFS_sint64 createtime;
+ PHYSFS_sint64 accesstime;
+ PHYSFS_FileType filetype;
+ int readonly;
} PHYSFS_Stat;
PHYSFS_DECL int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat);
diff -r 4feced261c68 -r de822cd3df3a misc/libphyslayer/physfsrwops.c
--- a/misc/libphyslayer/physfsrwops.c Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/libphyslayer/physfsrwops.c Tue Jan 21 22:43:06 2014 +0100
@@ -95,7 +95,7 @@
SDL_SetError("Attempt to seek past start of file.");
return -1;
} /* if */
-
+
if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos))
{
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
diff -r 4feced261c68 -r de822cd3df3a misc/theme_editor.html
--- a/misc/theme_editor.html Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/theme_editor.html Tue Jan 21 22:43:06 2014 +0100
@@ -7,113 +7,113 @@
var skyColor, waterTopColor, waterBottomColor;
var elements = 7;
var landArray;
-
+
function landFunction(x){
return 384 - 192 * Math.sin(x * Math.PI/512);
}
-
+
function tryToDraw(){
if (--elements <= 0) {
draw();
}
}
-
+
function load(){
var canvas = document.getElementById('preview');
if (canvas.getContext){
var ctx = canvas.getContext('2d');
-
+
ctx.fillStyle = '#0b294b';
ctx.fillRect(0, 0, 512, 384);
-
+
ctx.font = "40pt Arial";
ctx.fillStyle = '#2b7bd5';
ctx.fillText('Loading Images...', 32, 212);
}
-
+
sky = new Image();
sky.onload = tryToDraw;
sky.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Sky.png';
-
+
clouds = new Image();
clouds.onload = tryToDraw;
clouds.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/Clouds.png';
-
+
horizont = new Image();
horizont.onload = tryToDraw;
horizont.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/horizont.png';
-
+
land = new Image();
land.onload = tryToDraw;
land.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/LandTex.png';
-
+
border = new Image();
border.onload = tryToDraw;
border.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Border.png';
-
+
water = new Image();
water.onload = tryToDraw;
water.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/BlueWater.png';
-
+
landArray = new Array(512);
for (var x = 0; x < landArray.length; x++)
landArray[x] = landFunction(x);
-
+
skyColor = '#131252';
document.getElementById('skyColor').value = skyColor;
-
+
waterTopColor = '#555C9D';
document.getElementById('waterTopColor').value = waterTopColor;
-
+
waterBottomColor = '#343C7D';
document.getElementById('waterBottomColor').value = waterBottomColor;
-
+
tryToDraw();
}
-
+
function draw(){
var canvas = document.getElementById('preview');
if (canvas.getContext){
var ctx = canvas.getContext('2d');
-
+
ctx.fillStyle = skyColor;
ctx.fillRect(0, 0, 512, 384);
-
+
ctx.drawImage(sky, 0, 64, 512, 256);
-
+
for (var i = 0; i < 4; i++)
ctx.drawImage(clouds, 0, i * 128, 256, 128, i * 128, 64, 128, 64);
-
+
ctx.drawImage(horizont, 0, 192, 512, 128);
-
+
ctx.save();
-
+
ctx.beginPath();
ctx.moveTo(0, 384);
for (var x = 0; x < landArray.length; x++)
ctx.lineTo(x, landArray[x]);
ctx.clip();
-
+
for (var i = 0; i < 2; i++)
- for (var k = 0; k < 2; k++)
- ctx.drawImage(land, i * 320, k * 240, 320, 240);
-
+ for (var k = 0; k < 2; k++)
+ ctx.drawImage(land, i * 320, k * 240, 320, 240);
+
ctx.restore();
-
+
var k = 0;
for (var x = 0; x < landArray.length; x++) {
if (++k == 64)
k = 0;
ctx.drawImage(border, k, 0, 2, 16, x, landArray[x] - 4, 1, 8);
}
-
-
+
+
var gradient = ctx.createLinearGradient(0, 320, 0, 384);
gradient.addColorStop(0, waterTopColor);
gradient.addColorStop(1, waterBottomColor);
ctx.fillStyle = gradient;
ctx.fillRect(0, 320, 512, 384);
-
+
for (var i = 0; i < 8; i++)
ctx.drawImage(water, i * 64, 308, 64, 24);
}
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/GL/glut.h
--- a/misc/winutils/include/GL/glut.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/GL/glut.h Tue Jan 21 22:43:06 2014 +0100
@@ -1,716 +1,716 @@
-#ifndef __glut_h__
-#define __glut_h__
-
-/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
-
-/* This program is freely distributable without licensing fees and is
- provided without guarantee or warrantee expressed or implied. This
- program is -not- in the public domain. */
-
-#if defined(_WIN32)
-
-/* GLUT 3.7 now tries to avoid including
- to avoid name space pollution, but Win32's
- needs APIENTRY and WINGDIAPI defined properly. */
-# if 0
- /* This would put tons of macros and crap in our clean name space. */
-# define WIN32_LEAN_AND_MEAN
-# include
-# else
- /* XXX This is from Win32's */
-# ifndef APIENTRY
-# define GLUT_APIENTRY_DEFINED
-# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__)
-# define APIENTRY __stdcall
-# else
-# define APIENTRY
-# endif
-# endif
- /* XXX This is from Win32's */
-# ifndef CALLBACK
-# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) || defined(__LCC__)
-# define CALLBACK __stdcall
-# else
-# define CALLBACK
-# endif
-# endif
- /* XXX Hack for lcc compiler. It doesn't support __declspec(dllimport), just __stdcall. */
-# if defined( __LCC__ )
-# undef WINGDIAPI
-# define WINGDIAPI __stdcall
-# else
- /* XXX This is from Win32's and */
-# ifndef WINGDIAPI
-# define GLUT_WINGDIAPI_DEFINED
-# define WINGDIAPI __declspec(dllimport)
-# endif
-# endif
- /* XXX This is from Win32's */
-# ifndef _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-# define _WCHAR_T_DEFINED
-# endif
-# endif
-
-/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
- in your compile preprocessor options. */
-# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
-# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
-/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
- define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
-# ifdef GLUT_USE_SGI_OPENGL
-# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
-# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
-# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
-# else
-# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
-# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
-# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
-# endif
-# endif
-
-/* To disable supression of annoying warnings about floats being promoted
- to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
- options. */
-# ifndef GLUT_NO_WARNING_DISABLE
-# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
-# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
-# endif
-
-/* Win32 has an annoying issue where there are multiple C run-time
- libraries (CRTs). If the executable is linked with a different CRT
- from the GLUT DLL, the GLUT DLL will not share the same CRT static
- data seen by the executable. In particular, atexit callbacks registered
- in the executable will not be called if GLUT calls its (different)
- exit routine). GLUT is typically built with the
- "/MD" option (the CRT with multithreading DLL support), but the Visual
- C++ linker default is "/ML" (the single threaded CRT).
-
- One workaround to this issue is requiring users to always link with
- the same CRT as GLUT is compiled with. That requires users supply a
- non-standard option. GLUT 3.7 has its own built-in workaround where
- the executable's "exit" function pointer is covertly passed to GLUT.
- GLUT then calls the executable's exit function pointer to ensure that
- any "atexit" calls registered by the application are called if GLUT
- needs to exit.
-
- Note that the __glut*WithExit routines should NEVER be called directly.
- To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
-
-/* XXX This is from Win32's */
-# if !defined(_MSC_VER) && !defined(__cdecl)
- /* Define __cdecl for non-Microsoft compilers. */
-# define __cdecl
-# define GLUT_DEFINED___CDECL
-# endif
-# ifndef _CRTIMP
-# ifdef _NTSDK
- /* Definition compatible with NT SDK */
-# define _CRTIMP
-# else
- /* Current definition */
-# ifdef _DLL
-# define _CRTIMP __declspec(dllimport)
-# else
-# define _CRTIMP
-# endif
-# endif
-# define GLUT_DEFINED__CRTIMP
-# endif
-
-/* GLUT API entry point declarations for Win32. */
-# ifdef GLUT_BUILDING_LIB
-# define GLUTAPI __declspec(dllexport)
-# else
-# ifdef _DLL
-# define GLUTAPI __declspec(dllimport)
-# else
-# define GLUTAPI extern
-# endif
-# endif
-
-/* GLUT callback calling convention for Win32. */
-# define GLUTCALLBACK __cdecl
-
-#endif /* _WIN32 */
-
-#include
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_WIN32)
-# ifndef GLUT_BUILDING_LIB
-extern _CRTIMP void __cdecl exit(int);
-# endif
-#else
-/* non-Win32 case. */
-/* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */
-# define APIENTRY
-# define GLUT_APIENTRY_DEFINED
-# define CALLBACK
-/* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */
-# define GLUTAPI extern
-# define GLUTCALLBACK
-/* Prototype exit for the non-Win32 case (see above). */
-extern void exit(int);
-#endif
-
-/**
- GLUT API revision history:
-
- GLUT_API_VERSION is updated to reflect incompatible GLUT
- API changes (interface changes, semantic changes, deletions,
- or additions).
-
- GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
-
- GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
- extension. Supports new input devices like tablet, dial and button
- box, and Spaceball. Easy to query OpenGL extensions.
-
- GLUT_API_VERSION=3 glutMenuStatus added.
-
- GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
- glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
- video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
- glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
- glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
-**/
-#ifndef GLUT_API_VERSION /* allow this to be overriden */
-#define GLUT_API_VERSION 3
-#endif
-
-/**
- GLUT implementation revision history:
-
- GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
- API revisions and implementation revisions (ie, bug fixes).
-
- GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
- GLUT Xlib-based implementation. 11/29/94
-
- GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
- GLUT Xlib-based implementation providing GLUT version 2
- interfaces.
-
- GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
-
- GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
-
- GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
-
- GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
-
- GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
- and video resize. 1/3/97
-
- GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
-
- GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
-
- GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
-
- GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
-
- GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
-
- GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa
-**/
-#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
-#define GLUT_XLIB_IMPLEMENTATION 15
-#endif
-
-/* Display mode bit masks. */
-#define GLUT_RGB 0
-#define GLUT_RGBA GLUT_RGB
-#define GLUT_INDEX 1
-#define GLUT_SINGLE 0
-#define GLUT_DOUBLE 2
-#define GLUT_ACCUM 4
-#define GLUT_ALPHA 8
-#define GLUT_DEPTH 16
-#define GLUT_STENCIL 32
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_MULTISAMPLE 128
-#define GLUT_STEREO 256
-#endif
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_LUMINANCE 512
-#endif
-
-/* Mouse buttons. */
-#define GLUT_LEFT_BUTTON 0
-#define GLUT_MIDDLE_BUTTON 1
-#define GLUT_RIGHT_BUTTON 2
-
-/* Mouse button state. */
-#define GLUT_DOWN 0
-#define GLUT_UP 1
-
-#if (GLUT_API_VERSION >= 2)
-/* function keys */
-#define GLUT_KEY_F1 1
-#define GLUT_KEY_F2 2
-#define GLUT_KEY_F3 3
-#define GLUT_KEY_F4 4
-#define GLUT_KEY_F5 5
-#define GLUT_KEY_F6 6
-#define GLUT_KEY_F7 7
-#define GLUT_KEY_F8 8
-#define GLUT_KEY_F9 9
-#define GLUT_KEY_F10 10
-#define GLUT_KEY_F11 11
-#define GLUT_KEY_F12 12
-/* directional keys */
-#define GLUT_KEY_LEFT 100
-#define GLUT_KEY_UP 101
-#define GLUT_KEY_RIGHT 102
-#define GLUT_KEY_DOWN 103
-#define GLUT_KEY_PAGE_UP 104
-#define GLUT_KEY_PAGE_DOWN 105
-#define GLUT_KEY_HOME 106
-#define GLUT_KEY_END 107
-#define GLUT_KEY_INSERT 108
-#endif
-
-/* Entry/exit state. */
-#define GLUT_LEFT 0
-#define GLUT_ENTERED 1
-
-/* Menu usage state. */
-#define GLUT_MENU_NOT_IN_USE 0
-#define GLUT_MENU_IN_USE 1
-
-/* Visibility state. */
-#define GLUT_NOT_VISIBLE 0
-#define GLUT_VISIBLE 1
-
-/* Window status state. */
-#define GLUT_HIDDEN 0
-#define GLUT_FULLY_RETAINED 1
-#define GLUT_PARTIALLY_RETAINED 2
-#define GLUT_FULLY_COVERED 3
-
-/* Color index component selection values. */
-#define GLUT_RED 0
-#define GLUT_GREEN 1
-#define GLUT_BLUE 2
-
-#if defined(_WIN32)
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN ((void*)0)
-#define GLUT_STROKE_MONO_ROMAN ((void*)1)
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 ((void*)2)
-#define GLUT_BITMAP_8_BY_13 ((void*)3)
-#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
-#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
-#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
-#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
-#endif
-#else
-/* Stroke font opaque addresses (use constants instead in source code). */
-GLUTAPI void *glutStrokeRoman;
-GLUTAPI void *glutStrokeMonoRoman;
-
-/* Stroke font constants (use these in GLUT program). */
-#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
-#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
-
-/* Bitmap font opaque addresses (use constants instead in source code). */
-GLUTAPI void *glutBitmap9By15;
-GLUTAPI void *glutBitmap8By13;
-GLUTAPI void *glutBitmapTimesRoman10;
-GLUTAPI void *glutBitmapTimesRoman24;
-GLUTAPI void *glutBitmapHelvetica10;
-GLUTAPI void *glutBitmapHelvetica12;
-GLUTAPI void *glutBitmapHelvetica18;
-
-/* Bitmap font constants (use these in GLUT program). */
-#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
-#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
-#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
-#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
-#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
-#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
-#endif
-#endif
-
-/* glutGet parameters. */
-#define GLUT_WINDOW_X ((GLenum) 100)
-#define GLUT_WINDOW_Y ((GLenum) 101)
-#define GLUT_WINDOW_WIDTH ((GLenum) 102)
-#define GLUT_WINDOW_HEIGHT ((GLenum) 103)
-#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104)
-#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105)
-#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106)
-#define GLUT_WINDOW_RED_SIZE ((GLenum) 107)
-#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108)
-#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109)
-#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110)
-#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111)
-#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112)
-#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113)
-#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114)
-#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115)
-#define GLUT_WINDOW_RGBA ((GLenum) 116)
-#define GLUT_WINDOW_PARENT ((GLenum) 117)
-#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118)
-#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119)
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120)
-#define GLUT_WINDOW_STEREO ((GLenum) 121)
-#endif
-#if (GLUT_API_VERSION >= 3)
-#define GLUT_WINDOW_CURSOR ((GLenum) 122)
-#endif
-#define GLUT_SCREEN_WIDTH ((GLenum) 200)
-#define GLUT_SCREEN_HEIGHT ((GLenum) 201)
-#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202)
-#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203)
-#define GLUT_MENU_NUM_ITEMS ((GLenum) 300)
-#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400)
-#define GLUT_INIT_WINDOW_X ((GLenum) 500)
-#define GLUT_INIT_WINDOW_Y ((GLenum) 501)
-#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502)
-#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503)
-#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504)
-#if (GLUT_API_VERSION >= 2)
-#define GLUT_ELAPSED_TIME ((GLenum) 700)
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123)
-#endif
-
-#if (GLUT_API_VERSION >= 2)
-/* glutDeviceGet parameters. */
-#define GLUT_HAS_KEYBOARD ((GLenum) 600)
-#define GLUT_HAS_MOUSE ((GLenum) 601)
-#define GLUT_HAS_SPACEBALL ((GLenum) 602)
-#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603)
-#define GLUT_HAS_TABLET ((GLenum) 604)
-#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605)
-#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606)
-#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607)
-#define GLUT_NUM_DIALS ((GLenum) 608)
-#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609)
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610)
-#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611)
-#define GLUT_HAS_JOYSTICK ((GLenum) 612)
-#define GLUT_OWNS_JOYSTICK ((GLenum) 613)
-#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614)
-#define GLUT_JOYSTICK_AXES ((GLenum) 615)
-#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616)
-#endif
-
-#if (GLUT_API_VERSION >= 3)
-/* glutLayerGet parameters. */
-#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800)
-#define GLUT_LAYER_IN_USE ((GLenum) 801)
-#define GLUT_HAS_OVERLAY ((GLenum) 802)
-#define GLUT_TRANSPARENT_INDEX ((GLenum) 803)
-#define GLUT_NORMAL_DAMAGED ((GLenum) 804)
-#define GLUT_OVERLAY_DAMAGED ((GLenum) 805)
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-/* glutVideoResizeGet parameters. */
-#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900)
-#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901)
-#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902)
-#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903)
-#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904)
-#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905)
-#define GLUT_VIDEO_RESIZE_X ((GLenum) 906)
-#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907)
-#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908)
-#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909)
-#endif
-
-/* glutUseLayer parameters. */
-#define GLUT_NORMAL ((GLenum) 0)
-#define GLUT_OVERLAY ((GLenum) 1)
-
-/* glutGetModifiers return mask. */
-#define GLUT_ACTIVE_SHIFT 1
-#define GLUT_ACTIVE_CTRL 2
-#define GLUT_ACTIVE_ALT 4
-
-/* glutSetCursor parameters. */
-/* Basic arrows. */
-#define GLUT_CURSOR_RIGHT_ARROW 0
-#define GLUT_CURSOR_LEFT_ARROW 1
-/* Symbolic cursor shapes. */
-#define GLUT_CURSOR_INFO 2
-#define GLUT_CURSOR_DESTROY 3
-#define GLUT_CURSOR_HELP 4
-#define GLUT_CURSOR_CYCLE 5
-#define GLUT_CURSOR_SPRAY 6
-#define GLUT_CURSOR_WAIT 7
-#define GLUT_CURSOR_TEXT 8
-#define GLUT_CURSOR_CROSSHAIR 9
-/* Directional cursors. */
-#define GLUT_CURSOR_UP_DOWN 10
-#define GLUT_CURSOR_LEFT_RIGHT 11
-/* Sizing cursors. */
-#define GLUT_CURSOR_TOP_SIDE 12
-#define GLUT_CURSOR_BOTTOM_SIDE 13
-#define GLUT_CURSOR_LEFT_SIDE 14
-#define GLUT_CURSOR_RIGHT_SIDE 15
-#define GLUT_CURSOR_TOP_LEFT_CORNER 16
-#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
-#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
-#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
-/* Inherit from parent window. */
-#define GLUT_CURSOR_INHERIT 100
-/* Blank cursor. */
-#define GLUT_CURSOR_NONE 101
-/* Fullscreen crosshair (if available). */
-#define GLUT_CURSOR_FULL_CROSSHAIR 102
-#endif
-
-/* GLUT initialization sub-API. */
-GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI void APIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static void APIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
-#define glutInit glutInit_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void APIENTRY glutInitDisplayString(const char *string);
-#endif
-GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
-GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
-GLUTAPI void APIENTRY glutMainLoop(void);
-
-/* GLUT window sub-API. */
-GLUTAPI int APIENTRY glutCreateWindow(const char *title);
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static int APIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
-#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
-GLUTAPI void APIENTRY glutDestroyWindow(int win);
-GLUTAPI void APIENTRY glutPostRedisplay(void);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
-GLUTAPI void APIENTRY glutPostWindowRedisplay(int win);
-#endif
-GLUTAPI void APIENTRY glutSwapBuffers(void);
-GLUTAPI int APIENTRY glutGetWindow(void);
-GLUTAPI void APIENTRY glutSetWindow(int win);
-GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
-GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
-GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
-GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
-GLUTAPI void APIENTRY glutPopWindow(void);
-GLUTAPI void APIENTRY glutPushWindow(void);
-GLUTAPI void APIENTRY glutIconifyWindow(void);
-GLUTAPI void APIENTRY glutShowWindow(void);
-GLUTAPI void APIENTRY glutHideWindow(void);
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI void APIENTRY glutFullScreen(void);
-GLUTAPI void APIENTRY glutSetCursor(int cursor);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void APIENTRY glutWarpPointer(int x, int y);
-#endif
-
-/* GLUT overlay sub-API. */
-GLUTAPI void APIENTRY glutEstablishOverlay(void);
-GLUTAPI void APIENTRY glutRemoveOverlay(void);
-GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
-GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
-GLUTAPI void APIENTRY glutPostWindowOverlayRedisplay(int win);
-#endif
-GLUTAPI void APIENTRY glutShowOverlay(void);
-GLUTAPI void APIENTRY glutHideOverlay(void);
-#endif
-
-/* GLUT menu sub-API. */
-GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
-#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
-GLUTAPI int APIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
-#ifndef GLUT_BUILDING_LIB
-static int APIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
-#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
-#endif
-#endif
-GLUTAPI void APIENTRY glutDestroyMenu(int menu);
-GLUTAPI int APIENTRY glutGetMenu(void);
-GLUTAPI void APIENTRY glutSetMenu(int menu);
-GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
-GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
-GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
-GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
-GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
-GLUTAPI void APIENTRY glutAttachMenu(int button);
-GLUTAPI void APIENTRY glutDetachMenu(int button);
-
-/* GLUT window callback sub-API. */
-GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
-GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
-GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
-GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
-GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
-GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
-GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
-GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
-GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
-#if (GLUT_API_VERSION >= 2)
-GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
-GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
-GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
-GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
-GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
-GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
-GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
-GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
-#endif
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
-GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
-GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
-#endif
-#endif
-#endif
-
-/* GLUT color index sub-API. */
-GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
-GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
-GLUTAPI void APIENTRY glutCopyColormap(int win);
-
-/* GLUT state retrieval sub-API. */
-GLUTAPI int APIENTRY glutGet(GLenum type);
-GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
-#if (GLUT_API_VERSION >= 2)
-/* GLUT extension support sub-API */
-GLUTAPI int APIENTRY glutExtensionSupported(const char *name);
-#endif
-#if (GLUT_API_VERSION >= 3)
-GLUTAPI int APIENTRY glutGetModifiers(void);
-GLUTAPI int APIENTRY glutLayerGet(GLenum type);
-#endif
-
-/* GLUT font sub-API */
-GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
-GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
-GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-GLUTAPI int APIENTRY glutBitmapLength(void *font, const unsigned char *string);
-GLUTAPI int APIENTRY glutStrokeLength(void *font, const unsigned char *string);
-#endif
-
-/* GLUT pre-built models sub-API */
-GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-GLUTAPI void APIENTRY glutWireCube(GLdouble size);
-GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
-GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-GLUTAPI void APIENTRY glutWireDodecahedron(void);
-GLUTAPI void APIENTRY glutSolidDodecahedron(void);
-GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
-GLUTAPI void APIENTRY glutWireOctahedron(void);
-GLUTAPI void APIENTRY glutSolidOctahedron(void);
-GLUTAPI void APIENTRY glutWireTetrahedron(void);
-GLUTAPI void APIENTRY glutSolidTetrahedron(void);
-GLUTAPI void APIENTRY glutWireIcosahedron(void);
-GLUTAPI void APIENTRY glutSolidIcosahedron(void);
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-/* GLUT video resize sub-API. */
-GLUTAPI int APIENTRY glutVideoResizeGet(GLenum param);
-GLUTAPI void APIENTRY glutSetupVideoResizing(void);
-GLUTAPI void APIENTRY glutStopVideoResizing(void);
-GLUTAPI void APIENTRY glutVideoResize(int x, int y, int width, int height);
-GLUTAPI void APIENTRY glutVideoPan(int x, int y, int width, int height);
-
-/* GLUT debugging sub-API. */
-GLUTAPI void APIENTRY glutReportErrors(void);
-#endif
-
-#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
-/* GLUT device control sub-API. */
-/* glutSetKeyRepeat modes. */
-#define GLUT_KEY_REPEAT_OFF 0
-#define GLUT_KEY_REPEAT_ON 1
-#define GLUT_KEY_REPEAT_DEFAULT 2
-
-/* Joystick button masks. */
-#define GLUT_JOYSTICK_BUTTON_A 1
-#define GLUT_JOYSTICK_BUTTON_B 2
-#define GLUT_JOYSTICK_BUTTON_C 4
-#define GLUT_JOYSTICK_BUTTON_D 8
-
-GLUTAPI void APIENTRY glutIgnoreKeyRepeat(int ignore);
-GLUTAPI void APIENTRY glutSetKeyRepeat(int repeatMode);
-GLUTAPI void APIENTRY glutForceJoystickFunc(void);
-
-/* GLUT game mode sub-API. */
-/* glutGameModeGet. */
-#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0)
-#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1)
-#define GLUT_GAME_MODE_WIDTH ((GLenum) 2)
-#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3)
-#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4)
-#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5)
-#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6)
-
-GLUTAPI void APIENTRY glutGameModeString(const char *string);
-GLUTAPI int APIENTRY glutEnterGameMode(void);
-GLUTAPI void APIENTRY glutLeaveGameMode(void);
-GLUTAPI int APIENTRY glutGameModeGet(GLenum mode);
-#endif
-
-#ifdef __cplusplus
-}
-
-#endif
-
-#ifdef GLUT_APIENTRY_DEFINED
-# undef GLUT_APIENTRY_DEFINED
-# undef APIENTRY
-#endif
-
-#ifdef GLUT_WINGDIAPI_DEFINED
-# undef GLUT_WINGDIAPI_DEFINED
-# undef WINGDIAPI
-#endif
-
-#ifdef GLUT_DEFINED___CDECL
-# undef GLUT_DEFINED___CDECL
-# undef __cdecl
-#endif
-
-#ifdef GLUT_DEFINED__CRTIMP
-# undef GLUT_DEFINED__CRTIMP
-# undef _CRTIMP
-#endif
-
-#endif /* __glut_h__ */
+#ifndef __glut_h__
+#define __glut_h__
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
+
+/* This program is freely distributable without licensing fees and is
+ provided without guarantee or warrantee expressed or implied. This
+ program is -not- in the public domain. */
+
+#if defined(_WIN32)
+
+/* GLUT 3.7 now tries to avoid including
+ to avoid name space pollution, but Win32's
+ needs APIENTRY and WINGDIAPI defined properly. */
+# if 0
+ /* This would put tons of macros and crap in our clean name space. */
+# define WIN32_LEAN_AND_MEAN
+# include
+# else
+ /* XXX This is from Win32's */
+# ifndef APIENTRY
+# define GLUT_APIENTRY_DEFINED
+# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__)
+# define APIENTRY __stdcall
+# else
+# define APIENTRY
+# endif
+# endif
+ /* XXX This is from Win32's */
+# ifndef CALLBACK
+# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) || defined(__LCC__)
+# define CALLBACK __stdcall
+# else
+# define CALLBACK
+# endif
+# endif
+ /* XXX Hack for lcc compiler. It doesn't support __declspec(dllimport), just __stdcall. */
+# if defined( __LCC__ )
+# undef WINGDIAPI
+# define WINGDIAPI __stdcall
+# else
+ /* XXX This is from Win32's and */
+# ifndef WINGDIAPI
+# define GLUT_WINGDIAPI_DEFINED
+# define WINGDIAPI __declspec(dllimport)
+# endif
+# endif
+ /* XXX This is from Win32's */
+# ifndef _WCHAR_T_DEFINED
+typedef unsigned short wchar_t;
+# define _WCHAR_T_DEFINED
+# endif
+# endif
+
+/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
+ in your compile preprocessor options. */
+# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
+# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
+/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
+ define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
+# ifdef GLUT_USE_SGI_OPENGL
+# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
+# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
+# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
+# else
+# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
+# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
+# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
+# endif
+# endif
+
+/* To disable supression of annoying warnings about floats being promoted
+ to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
+ options. */
+# ifndef GLUT_NO_WARNING_DISABLE
+# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
+# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
+# endif
+
+/* Win32 has an annoying issue where there are multiple C run-time
+ libraries (CRTs). If the executable is linked with a different CRT
+ from the GLUT DLL, the GLUT DLL will not share the same CRT static
+ data seen by the executable. In particular, atexit callbacks registered
+ in the executable will not be called if GLUT calls its (different)
+ exit routine). GLUT is typically built with the
+ "/MD" option (the CRT with multithreading DLL support), but the Visual
+ C++ linker default is "/ML" (the single threaded CRT).
+
+ One workaround to this issue is requiring users to always link with
+ the same CRT as GLUT is compiled with. That requires users supply a
+ non-standard option. GLUT 3.7 has its own built-in workaround where
+ the executable's "exit" function pointer is covertly passed to GLUT.
+ GLUT then calls the executable's exit function pointer to ensure that
+ any "atexit" calls registered by the application are called if GLUT
+ needs to exit.
+
+ Note that the __glut*WithExit routines should NEVER be called directly.
+ To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
+
+/* XXX This is from Win32's */
+# if !defined(_MSC_VER) && !defined(__cdecl)
+ /* Define __cdecl for non-Microsoft compilers. */
+# define __cdecl
+# define GLUT_DEFINED___CDECL
+# endif
+# ifndef _CRTIMP
+# ifdef _NTSDK
+ /* Definition compatible with NT SDK */
+# define _CRTIMP
+# else
+ /* Current definition */
+# ifdef _DLL
+# define _CRTIMP __declspec(dllimport)
+# else
+# define _CRTIMP
+# endif
+# endif
+# define GLUT_DEFINED__CRTIMP
+# endif
+
+/* GLUT API entry point declarations for Win32. */
+# ifdef GLUT_BUILDING_LIB
+# define GLUTAPI __declspec(dllexport)
+# else
+# ifdef _DLL
+# define GLUTAPI __declspec(dllimport)
+# else
+# define GLUTAPI extern
+# endif
+# endif
+
+/* GLUT callback calling convention for Win32. */
+# define GLUTCALLBACK __cdecl
+
+#endif /* _WIN32 */
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32)
+# ifndef GLUT_BUILDING_LIB
+extern _CRTIMP void __cdecl exit(int);
+# endif
+#else
+/* non-Win32 case. */
+/* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */
+# define APIENTRY
+# define GLUT_APIENTRY_DEFINED
+# define CALLBACK
+/* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */
+# define GLUTAPI extern
+# define GLUTCALLBACK
+/* Prototype exit for the non-Win32 case (see above). */
+extern void exit(int);
+#endif
+
+/**
+ GLUT API revision history:
+
+ GLUT_API_VERSION is updated to reflect incompatible GLUT
+ API changes (interface changes, semantic changes, deletions,
+ or additions).
+
+ GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
+
+ GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
+ extension. Supports new input devices like tablet, dial and button
+ box, and Spaceball. Easy to query OpenGL extensions.
+
+ GLUT_API_VERSION=3 glutMenuStatus added.
+
+ GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
+ glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
+ video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
+ glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
+ glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
+**/
+#ifndef GLUT_API_VERSION /* allow this to be overriden */
+#define GLUT_API_VERSION 3
+#endif
+
+/**
+ GLUT implementation revision history:
+
+ GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
+ API revisions and implementation revisions (ie, bug fixes).
+
+ GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
+ GLUT Xlib-based implementation. 11/29/94
+
+ GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
+ GLUT Xlib-based implementation providing GLUT version 2
+ interfaces.
+
+ GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
+
+ GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
+
+ GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
+
+ GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
+
+ GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
+ and video resize. 1/3/97
+
+ GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
+
+ GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
+
+ GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
+
+ GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
+
+ GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
+
+ GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa
+**/
+#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
+#define GLUT_XLIB_IMPLEMENTATION 15
+#endif
+
+/* Display mode bit masks. */
+#define GLUT_RGB 0
+#define GLUT_RGBA GLUT_RGB
+#define GLUT_INDEX 1
+#define GLUT_SINGLE 0
+#define GLUT_DOUBLE 2
+#define GLUT_ACCUM 4
+#define GLUT_ALPHA 8
+#define GLUT_DEPTH 16
+#define GLUT_STENCIL 32
+#if (GLUT_API_VERSION >= 2)
+#define GLUT_MULTISAMPLE 128
+#define GLUT_STEREO 256
+#endif
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_LUMINANCE 512
+#endif
+
+/* Mouse buttons. */
+#define GLUT_LEFT_BUTTON 0
+#define GLUT_MIDDLE_BUTTON 1
+#define GLUT_RIGHT_BUTTON 2
+
+/* Mouse button state. */
+#define GLUT_DOWN 0
+#define GLUT_UP 1
+
+#if (GLUT_API_VERSION >= 2)
+/* function keys */
+#define GLUT_KEY_F1 1
+#define GLUT_KEY_F2 2
+#define GLUT_KEY_F3 3
+#define GLUT_KEY_F4 4
+#define GLUT_KEY_F5 5
+#define GLUT_KEY_F6 6
+#define GLUT_KEY_F7 7
+#define GLUT_KEY_F8 8
+#define GLUT_KEY_F9 9
+#define GLUT_KEY_F10 10
+#define GLUT_KEY_F11 11
+#define GLUT_KEY_F12 12
+/* directional keys */
+#define GLUT_KEY_LEFT 100
+#define GLUT_KEY_UP 101
+#define GLUT_KEY_RIGHT 102
+#define GLUT_KEY_DOWN 103
+#define GLUT_KEY_PAGE_UP 104
+#define GLUT_KEY_PAGE_DOWN 105
+#define GLUT_KEY_HOME 106
+#define GLUT_KEY_END 107
+#define GLUT_KEY_INSERT 108
+#endif
+
+/* Entry/exit state. */
+#define GLUT_LEFT 0
+#define GLUT_ENTERED 1
+
+/* Menu usage state. */
+#define GLUT_MENU_NOT_IN_USE 0
+#define GLUT_MENU_IN_USE 1
+
+/* Visibility state. */
+#define GLUT_NOT_VISIBLE 0
+#define GLUT_VISIBLE 1
+
+/* Window status state. */
+#define GLUT_HIDDEN 0
+#define GLUT_FULLY_RETAINED 1
+#define GLUT_PARTIALLY_RETAINED 2
+#define GLUT_FULLY_COVERED 3
+
+/* Color index component selection values. */
+#define GLUT_RED 0
+#define GLUT_GREEN 1
+#define GLUT_BLUE 2
+
+#if defined(_WIN32)
+/* Stroke font constants (use these in GLUT program). */
+#define GLUT_STROKE_ROMAN ((void*)0)
+#define GLUT_STROKE_MONO_ROMAN ((void*)1)
+
+/* Bitmap font constants (use these in GLUT program). */
+#define GLUT_BITMAP_9_BY_15 ((void*)2)
+#define GLUT_BITMAP_8_BY_13 ((void*)3)
+#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
+#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
+#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
+#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
+#endif
+#else
+/* Stroke font opaque addresses (use constants instead in source code). */
+GLUTAPI void *glutStrokeRoman;
+GLUTAPI void *glutStrokeMonoRoman;
+
+/* Stroke font constants (use these in GLUT program). */
+#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
+#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
+
+/* Bitmap font opaque addresses (use constants instead in source code). */
+GLUTAPI void *glutBitmap9By15;
+GLUTAPI void *glutBitmap8By13;
+GLUTAPI void *glutBitmapTimesRoman10;
+GLUTAPI void *glutBitmapTimesRoman24;
+GLUTAPI void *glutBitmapHelvetica10;
+GLUTAPI void *glutBitmapHelvetica12;
+GLUTAPI void *glutBitmapHelvetica18;
+
+/* Bitmap font constants (use these in GLUT program). */
+#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
+#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
+#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
+#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
+#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
+#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
+#endif
+#endif
+
+/* glutGet parameters. */
+#define GLUT_WINDOW_X ((GLenum) 100)
+#define GLUT_WINDOW_Y ((GLenum) 101)
+#define GLUT_WINDOW_WIDTH ((GLenum) 102)
+#define GLUT_WINDOW_HEIGHT ((GLenum) 103)
+#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104)
+#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105)
+#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106)
+#define GLUT_WINDOW_RED_SIZE ((GLenum) 107)
+#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108)
+#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109)
+#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110)
+#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111)
+#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112)
+#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113)
+#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114)
+#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115)
+#define GLUT_WINDOW_RGBA ((GLenum) 116)
+#define GLUT_WINDOW_PARENT ((GLenum) 117)
+#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118)
+#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119)
+#if (GLUT_API_VERSION >= 2)
+#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120)
+#define GLUT_WINDOW_STEREO ((GLenum) 121)
+#endif
+#if (GLUT_API_VERSION >= 3)
+#define GLUT_WINDOW_CURSOR ((GLenum) 122)
+#endif
+#define GLUT_SCREEN_WIDTH ((GLenum) 200)
+#define GLUT_SCREEN_HEIGHT ((GLenum) 201)
+#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202)
+#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203)
+#define GLUT_MENU_NUM_ITEMS ((GLenum) 300)
+#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400)
+#define GLUT_INIT_WINDOW_X ((GLenum) 500)
+#define GLUT_INIT_WINDOW_Y ((GLenum) 501)
+#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502)
+#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503)
+#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504)
+#if (GLUT_API_VERSION >= 2)
+#define GLUT_ELAPSED_TIME ((GLenum) 700)
+#endif
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123)
+#endif
+
+#if (GLUT_API_VERSION >= 2)
+/* glutDeviceGet parameters. */
+#define GLUT_HAS_KEYBOARD ((GLenum) 600)
+#define GLUT_HAS_MOUSE ((GLenum) 601)
+#define GLUT_HAS_SPACEBALL ((GLenum) 602)
+#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603)
+#define GLUT_HAS_TABLET ((GLenum) 604)
+#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605)
+#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606)
+#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607)
+#define GLUT_NUM_DIALS ((GLenum) 608)
+#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609)
+#endif
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610)
+#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611)
+#define GLUT_HAS_JOYSTICK ((GLenum) 612)
+#define GLUT_OWNS_JOYSTICK ((GLenum) 613)
+#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614)
+#define GLUT_JOYSTICK_AXES ((GLenum) 615)
+#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616)
+#endif
+
+#if (GLUT_API_VERSION >= 3)
+/* glutLayerGet parameters. */
+#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800)
+#define GLUT_LAYER_IN_USE ((GLenum) 801)
+#define GLUT_HAS_OVERLAY ((GLenum) 802)
+#define GLUT_TRANSPARENT_INDEX ((GLenum) 803)
+#define GLUT_NORMAL_DAMAGED ((GLenum) 804)
+#define GLUT_OVERLAY_DAMAGED ((GLenum) 805)
+
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+/* glutVideoResizeGet parameters. */
+#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900)
+#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901)
+#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902)
+#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903)
+#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904)
+#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905)
+#define GLUT_VIDEO_RESIZE_X ((GLenum) 906)
+#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907)
+#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908)
+#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909)
+#endif
+
+/* glutUseLayer parameters. */
+#define GLUT_NORMAL ((GLenum) 0)
+#define GLUT_OVERLAY ((GLenum) 1)
+
+/* glutGetModifiers return mask. */
+#define GLUT_ACTIVE_SHIFT 1
+#define GLUT_ACTIVE_CTRL 2
+#define GLUT_ACTIVE_ALT 4
+
+/* glutSetCursor parameters. */
+/* Basic arrows. */
+#define GLUT_CURSOR_RIGHT_ARROW 0
+#define GLUT_CURSOR_LEFT_ARROW 1
+/* Symbolic cursor shapes. */
+#define GLUT_CURSOR_INFO 2
+#define GLUT_CURSOR_DESTROY 3
+#define GLUT_CURSOR_HELP 4
+#define GLUT_CURSOR_CYCLE 5
+#define GLUT_CURSOR_SPRAY 6
+#define GLUT_CURSOR_WAIT 7
+#define GLUT_CURSOR_TEXT 8
+#define GLUT_CURSOR_CROSSHAIR 9
+/* Directional cursors. */
+#define GLUT_CURSOR_UP_DOWN 10
+#define GLUT_CURSOR_LEFT_RIGHT 11
+/* Sizing cursors. */
+#define GLUT_CURSOR_TOP_SIDE 12
+#define GLUT_CURSOR_BOTTOM_SIDE 13
+#define GLUT_CURSOR_LEFT_SIDE 14
+#define GLUT_CURSOR_RIGHT_SIDE 15
+#define GLUT_CURSOR_TOP_LEFT_CORNER 16
+#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
+#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
+#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
+/* Inherit from parent window. */
+#define GLUT_CURSOR_INHERIT 100
+/* Blank cursor. */
+#define GLUT_CURSOR_NONE 101
+/* Fullscreen crosshair (if available). */
+#define GLUT_CURSOR_FULL_CROSSHAIR 102
+#endif
+
+/* GLUT initialization sub-API. */
+GLUTAPI void APIENTRY glutInit(int *argcp, char **argv);
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+GLUTAPI void APIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
+#ifndef GLUT_BUILDING_LIB
+static void APIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
+#define glutInit glutInit_ATEXIT_HACK
+#endif
+#endif
+GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI void APIENTRY glutInitDisplayString(const char *string);
+#endif
+GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y);
+GLUTAPI void APIENTRY glutInitWindowSize(int width, int height);
+GLUTAPI void APIENTRY glutMainLoop(void);
+
+/* GLUT window sub-API. */
+GLUTAPI int APIENTRY glutCreateWindow(const char *title);
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
+#ifndef GLUT_BUILDING_LIB
+static int APIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
+#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
+#endif
+#endif
+GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
+GLUTAPI void APIENTRY glutDestroyWindow(int win);
+GLUTAPI void APIENTRY glutPostRedisplay(void);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
+GLUTAPI void APIENTRY glutPostWindowRedisplay(int win);
+#endif
+GLUTAPI void APIENTRY glutSwapBuffers(void);
+GLUTAPI int APIENTRY glutGetWindow(void);
+GLUTAPI void APIENTRY glutSetWindow(int win);
+GLUTAPI void APIENTRY glutSetWindowTitle(const char *title);
+GLUTAPI void APIENTRY glutSetIconTitle(const char *title);
+GLUTAPI void APIENTRY glutPositionWindow(int x, int y);
+GLUTAPI void APIENTRY glutReshapeWindow(int width, int height);
+GLUTAPI void APIENTRY glutPopWindow(void);
+GLUTAPI void APIENTRY glutPushWindow(void);
+GLUTAPI void APIENTRY glutIconifyWindow(void);
+GLUTAPI void APIENTRY glutShowWindow(void);
+GLUTAPI void APIENTRY glutHideWindow(void);
+#if (GLUT_API_VERSION >= 3)
+GLUTAPI void APIENTRY glutFullScreen(void);
+GLUTAPI void APIENTRY glutSetCursor(int cursor);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI void APIENTRY glutWarpPointer(int x, int y);
+#endif
+
+/* GLUT overlay sub-API. */
+GLUTAPI void APIENTRY glutEstablishOverlay(void);
+GLUTAPI void APIENTRY glutRemoveOverlay(void);
+GLUTAPI void APIENTRY glutUseLayer(GLenum layer);
+GLUTAPI void APIENTRY glutPostOverlayRedisplay(void);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
+GLUTAPI void APIENTRY glutPostWindowOverlayRedisplay(int win);
+#endif
+GLUTAPI void APIENTRY glutShowOverlay(void);
+GLUTAPI void APIENTRY glutHideOverlay(void);
+#endif
+
+/* GLUT menu sub-API. */
+GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+GLUTAPI int APIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
+#ifndef GLUT_BUILDING_LIB
+static int APIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
+#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
+#endif
+#endif
+GLUTAPI void APIENTRY glutDestroyMenu(int menu);
+GLUTAPI int APIENTRY glutGetMenu(void);
+GLUTAPI void APIENTRY glutSetMenu(int menu);
+GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value);
+GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu);
+GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
+GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
+GLUTAPI void APIENTRY glutRemoveMenuItem(int item);
+GLUTAPI void APIENTRY glutAttachMenu(int button);
+GLUTAPI void APIENTRY glutDetachMenu(int button);
+
+/* GLUT window callback sub-API. */
+GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
+GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
+GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
+GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
+GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
+GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
+GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
+GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
+GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
+GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
+GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
+#if (GLUT_API_VERSION >= 2)
+GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
+GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
+GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
+GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
+GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
+GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
+GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
+GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
+#if (GLUT_API_VERSION >= 3)
+GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
+GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
+#endif
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
+GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
+GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
+#endif
+#endif
+#endif
+
+/* GLUT color index sub-API. */
+GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
+GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component);
+GLUTAPI void APIENTRY glutCopyColormap(int win);
+
+/* GLUT state retrieval sub-API. */
+GLUTAPI int APIENTRY glutGet(GLenum type);
+GLUTAPI int APIENTRY glutDeviceGet(GLenum type);
+#if (GLUT_API_VERSION >= 2)
+/* GLUT extension support sub-API */
+GLUTAPI int APIENTRY glutExtensionSupported(const char *name);
+#endif
+#if (GLUT_API_VERSION >= 3)
+GLUTAPI int APIENTRY glutGetModifiers(void);
+GLUTAPI int APIENTRY glutLayerGet(GLenum type);
+#endif
+
+/* GLUT font sub-API */
+GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character);
+GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character);
+GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character);
+GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character);
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+GLUTAPI int APIENTRY glutBitmapLength(void *font, const unsigned char *string);
+GLUTAPI int APIENTRY glutStrokeLength(void *font, const unsigned char *string);
+#endif
+
+/* GLUT pre-built models sub-API */
+GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
+GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
+GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
+GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
+GLUTAPI void APIENTRY glutWireCube(GLdouble size);
+GLUTAPI void APIENTRY glutSolidCube(GLdouble size);
+GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+GLUTAPI void APIENTRY glutWireDodecahedron(void);
+GLUTAPI void APIENTRY glutSolidDodecahedron(void);
+GLUTAPI void APIENTRY glutWireTeapot(GLdouble size);
+GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size);
+GLUTAPI void APIENTRY glutWireOctahedron(void);
+GLUTAPI void APIENTRY glutSolidOctahedron(void);
+GLUTAPI void APIENTRY glutWireTetrahedron(void);
+GLUTAPI void APIENTRY glutSolidTetrahedron(void);
+GLUTAPI void APIENTRY glutWireIcosahedron(void);
+GLUTAPI void APIENTRY glutSolidIcosahedron(void);
+
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+/* GLUT video resize sub-API. */
+GLUTAPI int APIENTRY glutVideoResizeGet(GLenum param);
+GLUTAPI void APIENTRY glutSetupVideoResizing(void);
+GLUTAPI void APIENTRY glutStopVideoResizing(void);
+GLUTAPI void APIENTRY glutVideoResize(int x, int y, int width, int height);
+GLUTAPI void APIENTRY glutVideoPan(int x, int y, int width, int height);
+
+/* GLUT debugging sub-API. */
+GLUTAPI void APIENTRY glutReportErrors(void);
+#endif
+
+#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
+/* GLUT device control sub-API. */
+/* glutSetKeyRepeat modes. */
+#define GLUT_KEY_REPEAT_OFF 0
+#define GLUT_KEY_REPEAT_ON 1
+#define GLUT_KEY_REPEAT_DEFAULT 2
+
+/* Joystick button masks. */
+#define GLUT_JOYSTICK_BUTTON_A 1
+#define GLUT_JOYSTICK_BUTTON_B 2
+#define GLUT_JOYSTICK_BUTTON_C 4
+#define GLUT_JOYSTICK_BUTTON_D 8
+
+GLUTAPI void APIENTRY glutIgnoreKeyRepeat(int ignore);
+GLUTAPI void APIENTRY glutSetKeyRepeat(int repeatMode);
+GLUTAPI void APIENTRY glutForceJoystickFunc(void);
+
+/* GLUT game mode sub-API. */
+/* glutGameModeGet. */
+#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0)
+#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1)
+#define GLUT_GAME_MODE_WIDTH ((GLenum) 2)
+#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3)
+#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4)
+#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5)
+#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6)
+
+GLUTAPI void APIENTRY glutGameModeString(const char *string);
+GLUTAPI int APIENTRY glutEnterGameMode(void);
+GLUTAPI void APIENTRY glutLeaveGameMode(void);
+GLUTAPI int APIENTRY glutGameModeGet(GLenum mode);
+#endif
+
+#ifdef __cplusplus
+}
+
+#endif
+
+#ifdef GLUT_APIENTRY_DEFINED
+# undef GLUT_APIENTRY_DEFINED
+# undef APIENTRY
+#endif
+
+#ifdef GLUT_WINGDIAPI_DEFINED
+# undef GLUT_WINGDIAPI_DEFINED
+# undef WINGDIAPI
+#endif
+
+#ifdef GLUT_DEFINED___CDECL
+# undef GLUT_DEFINED___CDECL
+# undef __cdecl
+#endif
+
+#ifdef GLUT_DEFINED__CRTIMP
+# undef GLUT_DEFINED__CRTIMP
+# undef _CRTIMP
+#endif
+
+#endif /* __glut_h__ */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL.h
--- a/misc/winutils/include/SDL.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL.h Tue Jan 21 22:43:06 2014 +0100
@@ -58,17 +58,17 @@
* specify the subsystems which you will be using in your application.
*/
/*@{*/
-#define SDL_INIT_TIMER 0x00000001
-#define SDL_INIT_AUDIO 0x00000010
-#define SDL_INIT_VIDEO 0x00000020
-#define SDL_INIT_CDROM 0x00000100
-#define SDL_INIT_JOYSTICK 0x00000200
-#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
-#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */
-#define SDL_INIT_EVERYTHING 0x0000FFFF
+#define SDL_INIT_TIMER 0x00000001
+#define SDL_INIT_AUDIO 0x00000010
+#define SDL_INIT_VIDEO 0x00000020
+#define SDL_INIT_CDROM 0x00000100
+#define SDL_INIT_JOYSTICK 0x00000200
+#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
+#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */
+#define SDL_INIT_EVERYTHING 0x0000FFFF
/*@}*/
-/** This function loads the SDL dynamically linked library and initializes
+/** This function loads the SDL dynamically linked library and initializes
* the subsystems specified by 'flags' (and those satisfying dependencies)
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV)
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_active.h
--- a/misc/winutils/include/SDL_active.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_active.h Tue Jan 21 22:43:06 2014 +0100
@@ -22,7 +22,7 @@
/**
* @file SDL_active.h
- * Include file for SDL application focus event handling
+ * Include file for SDL application focus event handling
*/
#ifndef _SDL_active_h
@@ -39,13 +39,13 @@
/** @name The available application states */
/*@{*/
-#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */
-#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */
-#define SDL_APPACTIVE 0x04 /**< The application is active */
+#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */
+#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */
+#define SDL_APPACTIVE 0x04 /**< The application is active */
/*@}*/
/* Function prototypes */
-/**
+/**
* This function returns the current state of the application, which is a
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_audio.h
--- a/misc/winutils/include/SDL_audio.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_audio.h Tue Jan 21 22:43:06 2014 +0100
@@ -72,24 +72,24 @@
*
*/
typedef struct SDL_AudioSpec {
- int freq; /**< DSP frequency -- samples per second */
- Uint16 format; /**< Audio data format */
- Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
- Uint8 silence; /**< Audio buffer silence value (calculated) */
- Uint16 samples; /**< Audio buffer size in samples (power of 2) */
- Uint16 padding; /**< Necessary for some compile environments */
- Uint32 size; /**< Audio buffer size in bytes (calculated) */
- /**
- * This function is called when the audio device needs more data.
- *
- * @param[out] stream A pointer to the audio data buffer
- * @param[in] len The length of the audio buffer in bytes.
- *
- * Once the callback returns, the buffer will no longer be valid.
- * Stereo samples are stored in a LRLRLR ordering.
- */
- void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
- void *userdata;
+ int freq; /**< DSP frequency -- samples per second */
+ Uint16 format; /**< Audio data format */
+ Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
+ Uint8 silence; /**< Audio buffer silence value (calculated) */
+ Uint16 samples; /**< Audio buffer size in samples (power of 2) */
+ Uint16 padding; /**< Necessary for some compile environments */
+ Uint32 size; /**< Audio buffer size in bytes (calculated) */
+ /**
+ * This function is called when the audio device needs more data.
+ *
+ * @param[out] stream A pointer to the audio data buffer
+ * @param[in] len The length of the audio buffer in bytes.
+ *
+ * Once the callback returns, the buffer will no longer be valid.
+ * Stereo samples are stored in a LRLRLR ordering.
+ */
+ void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
+ void *userdata;
} SDL_AudioSpec;
/**
@@ -97,25 +97,25 @@
* defaults to LSB byte order
*/
/*@{*/
-#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
-#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
-#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
-#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
-#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
-#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
-#define AUDIO_U16 AUDIO_U16LSB
-#define AUDIO_S16 AUDIO_S16LSB
+#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
+#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
+#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
+#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
+#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
+#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
+#define AUDIO_U16 AUDIO_U16LSB
+#define AUDIO_S16 AUDIO_S16LSB
/**
* @name Native audio byte ordering
*/
/*@{*/
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define AUDIO_U16SYS AUDIO_U16LSB
-#define AUDIO_S16SYS AUDIO_S16LSB
+#define AUDIO_U16SYS AUDIO_U16LSB
+#define AUDIO_S16SYS AUDIO_S16LSB
#else
-#define AUDIO_U16SYS AUDIO_U16MSB
-#define AUDIO_S16SYS AUDIO_S16MSB
+#define AUDIO_U16SYS AUDIO_U16MSB
+#define AUDIO_S16SYS AUDIO_S16MSB
#endif
/*@}*/
@@ -124,17 +124,17 @@
/** A structure to hold a set of audio conversion filters and buffers */
typedef struct SDL_AudioCVT {
- int needed; /**< Set to 1 if conversion possible */
- Uint16 src_format; /**< Source audio format */
- Uint16 dst_format; /**< Target audio format */
- double rate_incr; /**< Rate conversion increment */
- Uint8 *buf; /**< Buffer to hold entire audio data */
- int len; /**< Length of original audio buffer */
- int len_cvt; /**< Length of converted audio buffer */
- int len_mult; /**< buffer must be len*len_mult big */
- double len_ratio; /**< Given len, final size is len*len_ratio */
- void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
- int filter_index; /**< Current audio conversion function */
+ int needed; /**< Set to 1 if conversion possible */
+ Uint16 src_format; /**< Source audio format */
+ Uint16 dst_format; /**< Target audio format */
+ double rate_incr; /**< Rate conversion increment */
+ Uint8 *buf; /**< Buffer to hold entire audio data */
+ int len; /**< Length of original audio buffer */
+ int len_cvt; /**< Length of converted audio buffer */
+ int len_mult; /**< buffer must be len*len_mult big */
+ double len_ratio; /**< Given len, final size is len*len_ratio */
+ void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+ int filter_index; /**< Current audio conversion function */
} SDL_AudioCVT;
@@ -164,7 +164,7 @@
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
* data passed to the callback function will be guaranteed to be in the
* requested format, and will be automatically converted to the hardware
- * audio format if necessary. This function returns -1 if it failed
+ * audio format if necessary. This function returns -1 if it failed
* to open the audio device, or couldn't set up the audio thread.
*
* The audio device starts out playing silence when it's opened, and should
@@ -178,9 +178,9 @@
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
typedef enum {
- SDL_AUDIO_STOPPED = 0,
- SDL_AUDIO_PLAYING,
- SDL_AUDIO_PAUSED
+ SDL_AUDIO_STOPPED = 0,
+ SDL_AUDIO_PLAYING,
+ SDL_AUDIO_PAUSED
} SDL_audiostatus;
/** Get the current audio state */
@@ -199,24 +199,24 @@
* This function loads a WAVE from the data source, automatically freeing
* that source if 'freesrc' is non-zero. For example, to load a WAVE file,
* you could do:
- * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode
+ * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode
*
* If this function succeeds, it returns the given SDL_AudioSpec,
* filled with the audio data format of the wave data, and sets
* 'audio_buf' to a malloc()'d buffer containing the audio data,
* and sets 'audio_len' to the length of that audio buffer, in bytes.
- * You need to free the audio buffer with SDL_FreeWAV() when you are
+ * You need to free the audio buffer with SDL_FreeWAV() when you are
* done with it.
*
- * This function returns NULL and sets the SDL error message if the
- * wave file cannot be opened, uses an unknown data format, or is
+ * This function returns NULL and sets the SDL error message if the
+ * wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
*/
extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/** Compatibility convenience function -- loads a WAV from a file */
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
- SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
+ SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
/**
* This function frees data previously allocated with SDL_LoadWAV_RW()
@@ -232,8 +232,8 @@
* @return This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
- Uint16 src_format, Uint8 src_channels, int src_rate,
- Uint16 dst_format, Uint8 dst_channels, int dst_rate);
+ Uint16 src_format, Uint8 src_channels, int src_rate,
+ Uint16 dst_format, Uint8 dst_channels, int dst_rate);
/**
* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_cdrom.h
--- a/misc/winutils/include/SDL_cdrom.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_cdrom.h Tue Jan 21 22:43:06 2014 +0100
@@ -45,47 +45,47 @@
*/
/** The maximum number of CD-ROM tracks on a disk */
-#define SDL_MAX_TRACKS 99
+#define SDL_MAX_TRACKS 99
/** @name Track Types
* The types of CD-ROM track possible
*/
/*@{*/
-#define SDL_AUDIO_TRACK 0x00
-#define SDL_DATA_TRACK 0x04
+#define SDL_AUDIO_TRACK 0x00
+#define SDL_DATA_TRACK 0x04
/*@}*/
/** The possible states which a CD-ROM drive can be in. */
typedef enum {
- CD_TRAYEMPTY,
- CD_STOPPED,
- CD_PLAYING,
- CD_PAUSED,
- CD_ERROR = -1
+ CD_TRAYEMPTY,
+ CD_STOPPED,
+ CD_PLAYING,
+ CD_PAUSED,
+ CD_ERROR = -1
} CDstatus;
/** Given a status, returns true if there's a disk in the drive */
-#define CD_INDRIVE(status) ((int)(status) > 0)
+#define CD_INDRIVE(status) ((int)(status) > 0)
typedef struct SDL_CDtrack {
- Uint8 id; /**< Track number */
- Uint8 type; /**< Data or audio track */
- Uint16 unused;
- Uint32 length; /**< Length, in frames, of this track */
- Uint32 offset; /**< Offset, in frames, from start of disk */
+ Uint8 id; /**< Track number */
+ Uint8 type; /**< Data or audio track */
+ Uint16 unused;
+ Uint32 length; /**< Length, in frames, of this track */
+ Uint32 offset; /**< Offset, in frames, from start of disk */
} SDL_CDtrack;
/** This structure is only current as of the last call to SDL_CDStatus() */
typedef struct SDL_CD {
- int id; /**< Private drive identifier */
- CDstatus status; /**< Current drive status */
+ int id; /**< Private drive identifier */
+ CDstatus status; /**< Current drive status */
- /** The rest of this structure is only valid if there's a CD in drive */
+ /** The rest of this structure is only valid if there's a CD in drive */
/*@{*/
- int numtracks; /**< Number of tracks on disk */
- int cur_track; /**< Current track position */
- int cur_frame; /**< Current frame offset within current track */
- SDL_CDtrack track[SDL_MAX_TRACKS+1];
+ int numtracks; /**< Number of tracks on disk */
+ int cur_track; /**< Current track position */
+ int cur_frame; /**< Current frame offset within current track */
+ SDL_CDtrack track[SDL_MAX_TRACKS+1];
/*@}*/
} SDL_CD;
@@ -93,16 +93,16 @@
* Conversion functions from frames to Minute/Second/Frames and vice versa
*/
/*@{*/
-#define CD_FPS 75
-#define FRAMES_TO_MSF(f, M,S,F) { \
- int value = f; \
- *(F) = value%CD_FPS; \
- value /= CD_FPS; \
- *(S) = value%60; \
- value /= 60; \
- *(M) = value; \
+#define CD_FPS 75
+#define FRAMES_TO_MSF(f, M,S,F) { \
+ int value = f; \
+ *(F) = value%CD_FPS; \
+ value /= CD_FPS; \
+ *(S) = value%60; \
+ value /= 60; \
+ *(M) = value; \
}
-#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
+#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
/*@}*/
/* CD-audio API functions: */
@@ -140,28 +140,28 @@
/**
* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
- * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
+ * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
* until the end of the CD. This function will skip data tracks.
- * This function should only be called after calling SDL_CDStatus() to
+ * This function should only be called after calling SDL_CDStatus() to
* get track information about the CD.
* For example:
* @code
- * // Play entire CD:
- * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
- * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
- * // Play last track:
- * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
- * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
- * }
- * // Play first and second track and 10 seconds of third track:
- * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
- * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
+ * // Play entire CD:
+ * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+ * // Play last track:
+ * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
+ * }
+ * // Play first and second track and 10 seconds of third track:
+ * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
* @endcode
*
* @return This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
- int start_track, int start_frame, int ntracks, int nframes);
+ int start_track, int start_frame, int ntracks, int nframes);
/**
* Play the given CD starting at 'start' frame for 'length' frames.
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_config_win32.h
--- a/misc/winutils/include/SDL_config_win32.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_config_win32.h Tue Jan 21 22:43:06 2014 +0100
@@ -28,16 +28,16 @@
/* This is a set of defines to configure the SDL features */
#if defined(__GNUC__) || defined(__DMC__)
-#define HAVE_STDINT_H 1
+#define HAVE_STDINT_H 1
#elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
+typedef signed __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef signed __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
#ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
@@ -53,7 +53,7 @@
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
#endif
-#else /* !__GNUC__ && !_MSC_VER */
+#else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
@@ -68,10 +68,10 @@
#endif
typedef unsigned int uintptr_t;
#endif /* __GNUC__ || _MSC_VER */
-#define SDL_HAS_64BIT_TYPE 1
+#define SDL_HAS_64BIT_TYPE 1
/* Enabled for SDL 1.2 (binary compatibility) */
-#define HAVE_LIBC 1
+#define HAVE_LIBC 1
#ifdef HAVE_LIBC
/* Useful headers */
#define HAVE_STDIO_H 1
@@ -117,67 +117,67 @@
#define HAVE__STRNICMP 1
#define HAVE_SSCANF 1
#else
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
#endif
/* Enable various audio drivers */
#ifndef _WIN32_WCE
-#define SDL_AUDIO_DRIVER_DSOUND 1
+#define SDL_AUDIO_DRIVER_DSOUND 1
#endif
-#define SDL_AUDIO_DRIVER_WAVEOUT 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
+#define SDL_AUDIO_DRIVER_WAVEOUT 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#ifdef _WIN32_WCE
#define SDL_CDROM_DISABLED 1
#else
-#define SDL_CDROM_WIN32 1
+#define SDL_CDROM_WIN32 1
#endif
/* Enable various input drivers */
#ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1
#else
-#define SDL_JOYSTICK_WINMM 1
+#define SDL_JOYSTICK_WINMM 1
#endif
/* Enable various shared object loading systems */
-#define SDL_LOADSO_WIN32 1
+#define SDL_LOADSO_WIN32 1
/* Enable various threading systems */
-#define SDL_THREAD_WIN32 1
+#define SDL_THREAD_WIN32 1
/* Enable various timer systems */
#ifdef _WIN32_WCE
-#define SDL_TIMER_WINCE 1
+#define SDL_TIMER_WINCE 1
#else
-#define SDL_TIMER_WIN32 1
+#define SDL_TIMER_WIN32 1
#endif
/* Enable various video drivers */
#ifdef _WIN32_WCE
-#define SDL_VIDEO_DRIVER_GAPI 1
+#define SDL_VIDEO_DRIVER_GAPI 1
#endif
#ifndef _WIN32_WCE
-#define SDL_VIDEO_DRIVER_DDRAW 1
+#define SDL_VIDEO_DRIVER_DDRAW 1
#endif
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_WINDIB 1
+#define SDL_VIDEO_DRIVER_DUMMY 1
+#define SDL_VIDEO_DRIVER_WINDIB 1
/* Enable OpenGL support */
#ifndef _WIN32_WCE
-#define SDL_VIDEO_OPENGL 1
-#define SDL_VIDEO_OPENGL_WGL 1
+#define SDL_VIDEO_OPENGL 1
+#define SDL_VIDEO_OPENGL_WGL 1
#endif
/* Disable screensaver */
-#define SDL_VIDEO_DISABLE_SCREENSAVER 1
+#define SDL_VIDEO_DISABLE_SCREENSAVER 1
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES 1
+#define SDL_ASSEMBLY_ROUTINES 1
#endif
#endif /* _SDL_config_win32_h */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_endian.h
--- a/misc/winutils/include/SDL_endian.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_endian.h Tue Jan 21 22:43:06 2014 +0100
@@ -31,14 +31,14 @@
#include "SDL_stdinc.h"
/** @name SDL_ENDIANs
- * The two types of endianness
+ * The two types of endianness
*/
/*@{*/
-#define SDL_LIL_ENDIAN 1234
-#define SDL_BIG_ENDIAN 4321
+#define SDL_LIL_ENDIAN 1234
+#define SDL_BIG_ENDIAN 4321
/*@}*/
-#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
+#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#ifdef __linux__
#include
#define SDL_BYTEORDER __BYTE_ORDER
@@ -48,9 +48,9 @@
(defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
-#define SDL_BYTEORDER SDL_BIG_ENDIAN
+#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
-#define SDL_BYTEORDER SDL_LIL_ENDIAN
+#define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif
#endif /* __linux __ */
#endif /* !SDL_BYTEORDER */
@@ -74,32 +74,32 @@
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
- __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
- return x;
+ __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
+ return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
- __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
- return x;
+ __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
+ return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
- Uint16 result;
+ Uint16 result;
- __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
- return result;
+ __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
+ return result;
}
#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
static __inline__ Uint16 SDL_Swap16(Uint16 x)
{
- __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
- return x;
+ __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
+ return x;
}
#else
static __inline__ Uint16 SDL_Swap16(Uint16 x) {
- return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
+ return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
}
#endif
@@ -107,34 +107,34 @@
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
- __asm__("bswap %0" : "=r" (x) : "0" (x));
- return x;
+ __asm__("bswap %0" : "=r" (x) : "0" (x));
+ return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
- __asm__("bswapl %0" : "=r" (x) : "0" (x));
- return x;
+ __asm__("bswapl %0" : "=r" (x) : "0" (x));
+ return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
- Uint32 result;
+ Uint32 result;
- __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
- __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
- __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
- return result;
+ __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
+ __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
+ __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
+ return result;
}
#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
static __inline__ Uint32 SDL_Swap32(Uint32 x)
{
- __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
- return x;
+ __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
+ return x;
}
#else
static __inline__ Uint32 SDL_Swap32(Uint32 x) {
- return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)));
+ return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)));
}
#endif
@@ -143,35 +143,35 @@
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
static __inline__ Uint64 SDL_Swap64(Uint64 x)
{
- union {
- struct { Uint32 a,b; } s;
- Uint64 u;
- } v;
- v.u = x;
- __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
- : "=r" (v.s.a), "=r" (v.s.b)
- : "0" (v.s.a), "1" (v.s.b));
- return v.u;
+ union {
+ struct { Uint32 a,b; } s;
+ Uint64 u;
+ } v;
+ v.u = x;
+ __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+ : "=r" (v.s.a), "=r" (v.s.b)
+ : "0" (v.s.a), "1" (v.s.b));
+ return v.u;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint64 SDL_Swap64(Uint64 x)
{
- __asm__("bswapq %0" : "=r" (x) : "0" (x));
- return x;
+ __asm__("bswapq %0" : "=r" (x) : "0" (x));
+ return x;
}
#else
static __inline__ Uint64 SDL_Swap64(Uint64 x)
{
- Uint32 hi, lo;
+ Uint32 hi, lo;
- /* Separate into high and low 32-bit values and swap them */
- lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
- x >>= 32;
- hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
- x = SDL_Swap32(lo);
- x <<= 32;
- x |= SDL_Swap32(hi);
- return (x);
+ /* Separate into high and low 32-bit values and swap them */
+ lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+ x >>= 32;
+ hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+ x = SDL_Swap32(lo);
+ x <<= 32;
+ x |= SDL_Swap32(hi);
+ return (x);
}
#endif
#else
@@ -179,7 +179,7 @@
* If there is no real 64-bit datatype, then compilers will complain about
* the fake 64-bit datatype that SDL provides when it compiles user code.
*/
-#define SDL_Swap64(X) (X)
+#define SDL_Swap64(X) (X)
#endif /* SDL_HAS_64BIT_TYPE */
/*@}*/
@@ -189,19 +189,19 @@
*/
/*@{*/
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define SDL_SwapLE16(X) (X)
-#define SDL_SwapLE32(X) (X)
-#define SDL_SwapLE64(X) (X)
-#define SDL_SwapBE16(X) SDL_Swap16(X)
-#define SDL_SwapBE32(X) SDL_Swap32(X)
-#define SDL_SwapBE64(X) SDL_Swap64(X)
+#define SDL_SwapLE16(X) (X)
+#define SDL_SwapLE32(X) (X)
+#define SDL_SwapLE64(X) (X)
+#define SDL_SwapBE16(X) SDL_Swap16(X)
+#define SDL_SwapBE32(X) SDL_Swap32(X)
+#define SDL_SwapBE64(X) SDL_Swap64(X)
#else
-#define SDL_SwapLE16(X) SDL_Swap16(X)
-#define SDL_SwapLE32(X) SDL_Swap32(X)
-#define SDL_SwapLE64(X) SDL_Swap64(X)
-#define SDL_SwapBE16(X) (X)
-#define SDL_SwapBE32(X) (X)
-#define SDL_SwapBE64(X) (X)
+#define SDL_SwapLE16(X) SDL_Swap16(X)
+#define SDL_SwapLE32(X) SDL_Swap32(X)
+#define SDL_SwapLE64(X) SDL_Swap64(X)
+#define SDL_SwapBE16(X) (X)
+#define SDL_SwapBE32(X) (X)
+#define SDL_SwapBE64(X) (X)
#endif
/*@}*/
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_error.h
--- a/misc/winutils/include/SDL_error.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_error.h Tue Jan 21 22:43:06 2014 +0100
@@ -36,7 +36,7 @@
extern "C" {
#endif
-/**
+/**
* @name Public functions
*/
/*@{*/
@@ -50,15 +50,15 @@
* @internal Private error message function - used internally
*/
/*@{*/
-#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
-#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
+#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
+#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
typedef enum {
- SDL_ENOMEM,
- SDL_EFREAD,
- SDL_EFWRITE,
- SDL_EFSEEK,
- SDL_UNSUPPORTED,
- SDL_LASTERROR
+ SDL_ENOMEM,
+ SDL_EFREAD,
+ SDL_EFWRITE,
+ SDL_EFSEEK,
+ SDL_UNSUPPORTED,
+ SDL_LASTERROR
} SDL_errorcode;
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
/*@}*/
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_events.h
--- a/misc/winutils/include/SDL_events.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_events.h Tue Jan 21 22:43:06 2014 +0100
@@ -44,147 +44,147 @@
/** @name General keyboard/mouse state definitions */
/*@{*/
-#define SDL_RELEASED 0
-#define SDL_PRESSED 1
+#define SDL_RELEASED 0
+#define SDL_PRESSED 1
/*@}*/
/** Event enumerations */
typedef enum {
- SDL_NOEVENT = 0, /**< Unused (do not remove) */
- SDL_ACTIVEEVENT, /**< Application loses/gains visibility */
- SDL_KEYDOWN, /**< Keys pressed */
- SDL_KEYUP, /**< Keys released */
- SDL_MOUSEMOTION, /**< Mouse moved */
- SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
- SDL_MOUSEBUTTONUP, /**< Mouse button released */
- SDL_JOYAXISMOTION, /**< Joystick axis motion */
- SDL_JOYBALLMOTION, /**< Joystick trackball motion */
- SDL_JOYHATMOTION, /**< Joystick hat position change */
- SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
- SDL_JOYBUTTONUP, /**< Joystick button released */
- SDL_QUIT, /**< User-requested quit */
- SDL_SYSWMEVENT, /**< System specific event */
- SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */
- SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */
- SDL_VIDEORESIZE, /**< User resized video mode */
- SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */
- SDL_EVENT_RESERVED2, /**< Reserved for future use.. */
- SDL_EVENT_RESERVED3, /**< Reserved for future use.. */
- SDL_EVENT_RESERVED4, /**< Reserved for future use.. */
- SDL_EVENT_RESERVED5, /**< Reserved for future use.. */
- SDL_EVENT_RESERVED6, /**< Reserved for future use.. */
- SDL_EVENT_RESERVED7, /**< Reserved for future use.. */
+ SDL_NOEVENT = 0, /**< Unused (do not remove) */
+ SDL_ACTIVEEVENT, /**< Application loses/gains visibility */
+ SDL_KEYDOWN, /**< Keys pressed */
+ SDL_KEYUP, /**< Keys released */
+ SDL_MOUSEMOTION, /**< Mouse moved */
+ SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
+ SDL_MOUSEBUTTONUP, /**< Mouse button released */
+ SDL_JOYAXISMOTION, /**< Joystick axis motion */
+ SDL_JOYBALLMOTION, /**< Joystick trackball motion */
+ SDL_JOYHATMOTION, /**< Joystick hat position change */
+ SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
+ SDL_JOYBUTTONUP, /**< Joystick button released */
+ SDL_QUIT, /**< User-requested quit */
+ SDL_SYSWMEVENT, /**< System specific event */
+ SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */
+ SDL_VIDEORESIZE, /**< User resized video mode */
+ SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */
+ SDL_EVENT_RESERVED2, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED3, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED4, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED5, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED6, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED7, /**< Reserved for future use.. */
/** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
SDL_USEREVENT = 24,
/** This last event is only for bounding internal arrays
- * It is the number of bits in the event mask datatype -- Uint32
+ * It is the number of bits in the event mask datatype -- Uint32
*/
SDL_NUMEVENTS = 32
} SDL_EventType;
/** @name Predefined event masks */
/*@{*/
-#define SDL_EVENTMASK(X) (1<<(X))
+#define SDL_EVENTMASK(X) (1<<(X))
typedef enum {
- SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
- SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
- SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
- SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
- SDL_EVENTMASK(SDL_KEYUP),
- SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
- SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
- SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
- SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
- SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
- SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
- SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
- SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
- SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
- SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
- SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
- SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
- SDL_EVENTMASK(SDL_JOYBALLMOTION)|
- SDL_EVENTMASK(SDL_JOYHATMOTION)|
- SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
- SDL_EVENTMASK(SDL_JOYBUTTONUP),
- SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
- SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
- SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
- SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
+ SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
+ SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
+ SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
+ SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
+ SDL_EVENTMASK(SDL_KEYUP),
+ SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
+ SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
+ SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+ SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
+ SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
+ SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+ SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
+ SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
+ SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
+ SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
+ SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
+ SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
+ SDL_EVENTMASK(SDL_JOYBALLMOTION)|
+ SDL_EVENTMASK(SDL_JOYHATMOTION)|
+ SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
+ SDL_EVENTMASK(SDL_JOYBUTTONUP),
+ SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
+ SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
+ SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
+ SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
} SDL_EventMask ;
-#define SDL_ALLEVENTS 0xFFFFFFFF
+#define SDL_ALLEVENTS 0xFFFFFFFF
/*@}*/
/** Application visibility event structure */
typedef struct SDL_ActiveEvent {
- Uint8 type; /**< SDL_ACTIVEEVENT */
- Uint8 gain; /**< Whether given states were gained or lost (1/0) */
- Uint8 state; /**< A mask of the focus states */
+ Uint8 type; /**< SDL_ACTIVEEVENT */
+ Uint8 gain; /**< Whether given states were gained or lost (1/0) */
+ Uint8 state; /**< A mask of the focus states */
} SDL_ActiveEvent;
/** Keyboard event structure */
typedef struct SDL_KeyboardEvent {
- Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */
- Uint8 which; /**< The keyboard device index */
- Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
- SDL_keysym keysym;
+ Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */
+ Uint8 which; /**< The keyboard device index */
+ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
+ SDL_keysym keysym;
} SDL_KeyboardEvent;
/** Mouse motion event structure */
typedef struct SDL_MouseMotionEvent {
- Uint8 type; /**< SDL_MOUSEMOTION */
- Uint8 which; /**< The mouse device index */
- Uint8 state; /**< The current button state */
- Uint16 x, y; /**< The X/Y coordinates of the mouse */
- Sint16 xrel; /**< The relative motion in the X direction */
- Sint16 yrel; /**< The relative motion in the Y direction */
+ Uint8 type; /**< SDL_MOUSEMOTION */
+ Uint8 which; /**< The mouse device index */
+ Uint8 state; /**< The current button state */
+ Uint16 x, y; /**< The X/Y coordinates of the mouse */
+ Sint16 xrel; /**< The relative motion in the X direction */
+ Sint16 yrel; /**< The relative motion in the Y direction */
} SDL_MouseMotionEvent;
/** Mouse button event structure */
typedef struct SDL_MouseButtonEvent {
- Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
- Uint8 which; /**< The mouse device index */
- Uint8 button; /**< The mouse button index */
- Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
- Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */
+ Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
+ Uint8 which; /**< The mouse device index */
+ Uint8 button; /**< The mouse button index */
+ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
+ Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */
} SDL_MouseButtonEvent;
/** Joystick axis motion event structure */
typedef struct SDL_JoyAxisEvent {
- Uint8 type; /**< SDL_JOYAXISMOTION */
- Uint8 which; /**< The joystick device index */
- Uint8 axis; /**< The joystick axis index */
- Sint16 value; /**< The axis value (range: -32768 to 32767) */
+ Uint8 type; /**< SDL_JOYAXISMOTION */
+ Uint8 which; /**< The joystick device index */
+ Uint8 axis; /**< The joystick axis index */
+ Sint16 value; /**< The axis value (range: -32768 to 32767) */
} SDL_JoyAxisEvent;
/** Joystick trackball motion event structure */
typedef struct SDL_JoyBallEvent {
- Uint8 type; /**< SDL_JOYBALLMOTION */
- Uint8 which; /**< The joystick device index */
- Uint8 ball; /**< The joystick trackball index */
- Sint16 xrel; /**< The relative motion in the X direction */
- Sint16 yrel; /**< The relative motion in the Y direction */
+ Uint8 type; /**< SDL_JOYBALLMOTION */
+ Uint8 which; /**< The joystick device index */
+ Uint8 ball; /**< The joystick trackball index */
+ Sint16 xrel; /**< The relative motion in the X direction */
+ Sint16 yrel; /**< The relative motion in the Y direction */
} SDL_JoyBallEvent;
/** Joystick hat position change event structure */
typedef struct SDL_JoyHatEvent {
- Uint8 type; /**< SDL_JOYHATMOTION */
- Uint8 which; /**< The joystick device index */
- Uint8 hat; /**< The joystick hat index */
- Uint8 value; /**< The hat position value:
- * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
- * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
- * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
- * Note that zero means the POV is centered.
- */
+ Uint8 type; /**< SDL_JOYHATMOTION */
+ Uint8 which; /**< The joystick device index */
+ Uint8 hat; /**< The joystick hat index */
+ Uint8 value; /**< The hat position value:
+ * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
+ * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
+ * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
+ * Note that zero means the POV is centered.
+ */
} SDL_JoyHatEvent;
/** Joystick button event structure */
typedef struct SDL_JoyButtonEvent {
- Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
- Uint8 which; /**< The joystick device index */
- Uint8 button; /**< The joystick button index */
- Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
+ Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
+ Uint8 which; /**< The joystick device index */
+ Uint8 button; /**< The joystick button index */
+ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
} SDL_JoyButtonEvent;
/** The "window resized" event
@@ -192,53 +192,53 @@
* mode with the new width and height.
*/
typedef struct SDL_ResizeEvent {
- Uint8 type; /**< SDL_VIDEORESIZE */
- int w; /**< New width */
- int h; /**< New height */
+ Uint8 type; /**< SDL_VIDEORESIZE */
+ int w; /**< New width */
+ int h; /**< New height */
} SDL_ResizeEvent;
/** The "screen redraw" event */
typedef struct SDL_ExposeEvent {
- Uint8 type; /**< SDL_VIDEOEXPOSE */
+ Uint8 type; /**< SDL_VIDEOEXPOSE */
} SDL_ExposeEvent;
/** The "quit requested" event */
typedef struct SDL_QuitEvent {
- Uint8 type; /**< SDL_QUIT */
+ Uint8 type; /**< SDL_QUIT */
} SDL_QuitEvent;
/** A user-defined event type */
typedef struct SDL_UserEvent {
- Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */
- int code; /**< User defined event code */
- void *data1; /**< User defined data pointer */
- void *data2; /**< User defined data pointer */
+ Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */
+ int code; /**< User defined event code */
+ void *data1; /**< User defined data pointer */
+ void *data2; /**< User defined data pointer */
} SDL_UserEvent;
/** If you want to use this event, you should include SDL_syswm.h */
struct SDL_SysWMmsg;
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct SDL_SysWMEvent {
- Uint8 type;
- SDL_SysWMmsg *msg;
+ Uint8 type;
+ SDL_SysWMmsg *msg;
} SDL_SysWMEvent;
/** General event structure */
typedef union SDL_Event {
- Uint8 type;
- SDL_ActiveEvent active;
- SDL_KeyboardEvent key;
- SDL_MouseMotionEvent motion;
- SDL_MouseButtonEvent button;
- SDL_JoyAxisEvent jaxis;
- SDL_JoyBallEvent jball;
- SDL_JoyHatEvent jhat;
- SDL_JoyButtonEvent jbutton;
- SDL_ResizeEvent resize;
- SDL_ExposeEvent expose;
- SDL_QuitEvent quit;
- SDL_UserEvent user;
- SDL_SysWMEvent syswm;
+ Uint8 type;
+ SDL_ActiveEvent active;
+ SDL_KeyboardEvent key;
+ SDL_MouseMotionEvent motion;
+ SDL_MouseButtonEvent button;
+ SDL_JoyAxisEvent jaxis;
+ SDL_JoyBallEvent jball;
+ SDL_JoyHatEvent jhat;
+ SDL_JoyButtonEvent jbutton;
+ SDL_ResizeEvent resize;
+ SDL_ExposeEvent expose;
+ SDL_QuitEvent quit;
+ SDL_UserEvent user;
+ SDL_SysWMEvent syswm;
} SDL_Event;
@@ -251,9 +251,9 @@
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
typedef enum {
- SDL_ADDEVENT,
- SDL_PEEKEVENT,
- SDL_GETEVENT
+ SDL_ADDEVENT,
+ SDL_PEEKEVENT,
+ SDL_GETEVENT
} SDL_eventaction;
/**
@@ -264,7 +264,7 @@
* If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
* of the event queue, matching 'mask', will be returned and will not
* be removed from the queue.
- * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
+ * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
* of the event queue, matching 'mask', will be returned and will be
* removed from the queue.
*
@@ -275,7 +275,7 @@
* This function is thread-safe.
*/
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
- SDL_eventaction action, Uint32 mask);
+ SDL_eventaction action, Uint32 mask);
/** Polls for currently pending events, and returns 1 if there are any pending
* events, or 0 if there are none available. If 'event' is not NULL, the next
@@ -306,11 +306,11 @@
* @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode
*
* If the filter returns 1, then the event will be added to the internal queue.
- * If it returns 0, then the event will be dropped from the queue, but the
+ * If it returns 0, then the event will be dropped from the queue, but the
* internal state will still be updated. This allows selective filtering of
* dynamically arriving events.
*
- * @warning Be very careful of what you do in the event filter function, as
+ * @warning Be very careful of what you do in the event filter function, as
* it may run in a different thread!
*
* There is one caveat when dealing with the SDL_QUITEVENT event type. The
@@ -331,10 +331,10 @@
/** @name Event State */
/*@{*/
-#define SDL_QUERY -1
-#define SDL_IGNORE 0
-#define SDL_DISABLE 0
-#define SDL_ENABLE 1
+#define SDL_QUERY -1
+#define SDL_IGNORE 0
+#define SDL_DISABLE 0
+#define SDL_ENABLE 1
/*@}*/
/**
@@ -342,7 +342,7 @@
* If 'state' is set to SDL_IGNORE, that event will be automatically dropped
* from the event queue and will not event be filtered.
* If 'state' is set to SDL_ENABLE, that event will be processed normally.
-* If 'state' is set to SDL_QUERY, SDL_EventState() will return the
+* If 'state' is set to SDL_QUERY, SDL_EventState() will return the
* current processing state of the specified event.
*/
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_joystick.h
--- a/misc/winutils/include/SDL_joystick.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_joystick.h Tue Jan 21 22:43:06 2014 +0100
@@ -138,18 +138,18 @@
* The return value of SDL_JoystickGetHat() is one of the following positions:
*/
/*@{*/
-#define SDL_HAT_CENTERED 0x00
-#define SDL_HAT_UP 0x01
-#define SDL_HAT_RIGHT 0x02
-#define SDL_HAT_DOWN 0x04
-#define SDL_HAT_LEFT 0x08
-#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
-#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
-#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
-#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
+#define SDL_HAT_CENTERED 0x00
+#define SDL_HAT_UP 0x01
+#define SDL_HAT_RIGHT 0x02
+#define SDL_HAT_DOWN 0x04
+#define SDL_HAT_LEFT 0x08
+#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
+#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
+#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
+#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
/*@}*/
-/**
+/**
* Get the current state of a POV hat on a joystick
*
* @param[in] hat The hat indices start at index 0.
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_keyboard.h
--- a/misc/winutils/include/SDL_keyboard.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_keyboard.h Tue Jan 21 22:43:06 2014 +0100
@@ -48,23 +48,23 @@
* high 9 bits of the character are 0, then this maps to the equivalent
* ASCII character:
* @code
- * char ch;
- * if ( (keysym.unicode & 0xFF80) == 0 ) {
- * ch = keysym.unicode & 0x7F;
- * } else {
- * An international character..
- * }
+ * char ch;
+ * if ( (keysym.unicode & 0xFF80) == 0 ) {
+ * ch = keysym.unicode & 0x7F;
+ * } else {
+ * An international character..
+ * }
* @endcode
*/
typedef struct SDL_keysym {
- Uint8 scancode; /**< hardware specific scancode */
- SDLKey sym; /**< SDL virtual keysym */
- SDLMod mod; /**< current key modifiers */
- Uint16 unicode; /**< translated character */
+ Uint8 scancode; /**< hardware specific scancode */
+ SDLKey sym; /**< SDL virtual keysym */
+ SDLMod mod; /**< current key modifiers */
+ Uint16 unicode; /**< translated character */
} SDL_keysym;
/** This is the mask which refers to all hotkey bindings */
-#define SDL_ALL_HOTKEYS 0xFFFFFFFF
+#define SDL_ALL_HOTKEYS 0xFFFFFFFF
/* Function prototypes */
/**
@@ -81,8 +81,8 @@
*/
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
-#define SDL_DEFAULT_REPEAT_DELAY 500
-#define SDL_DEFAULT_REPEAT_INTERVAL 30
+#define SDL_DEFAULT_REPEAT_DELAY 500
+#define SDL_DEFAULT_REPEAT_INTERVAL 30
/**
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
*
@@ -102,10 +102,10 @@
* Get a snapshot of the current state of the keyboard.
* Returns an array of keystates, indexed by the SDLK_* syms.
* Usage:
- * @code
- * Uint8 *keystate = SDL_GetKeyState(NULL);
- * if ( keystate[SDLK_RETURN] ) //... \ is pressed.
- * @endcode
+ * @code
+ * Uint8 *keystate = SDL_GetKeyState(NULL);
+ * if ( keystate[SDLK_RETURN] ) //... \ is pressed.
+ * @endcode
*/
extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_keysym.h
--- a/misc/winutils/include/SDL_keysym.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_keysym.h Tue Jan 21 22:43:06 2014 +0100
@@ -33,294 +33,294 @@
* The keyboard syms have been cleverly chosen to map to ASCII
*/
/*@{*/
- SDLK_UNKNOWN = 0,
- SDLK_FIRST = 0,
- SDLK_BACKSPACE = 8,
- SDLK_TAB = 9,
- SDLK_CLEAR = 12,
- SDLK_RETURN = 13,
- SDLK_PAUSE = 19,
- SDLK_ESCAPE = 27,
- SDLK_SPACE = 32,
- SDLK_EXCLAIM = 33,
- SDLK_QUOTEDBL = 34,
- SDLK_HASH = 35,
- SDLK_DOLLAR = 36,
- SDLK_AMPERSAND = 38,
- SDLK_QUOTE = 39,
- SDLK_LEFTPAREN = 40,
- SDLK_RIGHTPAREN = 41,
- SDLK_ASTERISK = 42,
- SDLK_PLUS = 43,
- SDLK_COMMA = 44,
- SDLK_MINUS = 45,
- SDLK_PERIOD = 46,
- SDLK_SLASH = 47,
- SDLK_0 = 48,
- SDLK_1 = 49,
- SDLK_2 = 50,
- SDLK_3 = 51,
- SDLK_4 = 52,
- SDLK_5 = 53,
- SDLK_6 = 54,
- SDLK_7 = 55,
- SDLK_8 = 56,
- SDLK_9 = 57,
- SDLK_COLON = 58,
- SDLK_SEMICOLON = 59,
- SDLK_LESS = 60,
- SDLK_EQUALS = 61,
- SDLK_GREATER = 62,
- SDLK_QUESTION = 63,
- SDLK_AT = 64,
- /*
- Skip uppercase letters
- */
- SDLK_LEFTBRACKET = 91,
- SDLK_BACKSLASH = 92,
- SDLK_RIGHTBRACKET = 93,
- SDLK_CARET = 94,
- SDLK_UNDERSCORE = 95,
- SDLK_BACKQUOTE = 96,
- SDLK_a = 97,
- SDLK_b = 98,
- SDLK_c = 99,
- SDLK_d = 100,
- SDLK_e = 101,
- SDLK_f = 102,
- SDLK_g = 103,
- SDLK_h = 104,
- SDLK_i = 105,
- SDLK_j = 106,
- SDLK_k = 107,
- SDLK_l = 108,
- SDLK_m = 109,
- SDLK_n = 110,
- SDLK_o = 111,
- SDLK_p = 112,
- SDLK_q = 113,
- SDLK_r = 114,
- SDLK_s = 115,
- SDLK_t = 116,
- SDLK_u = 117,
- SDLK_v = 118,
- SDLK_w = 119,
- SDLK_x = 120,
- SDLK_y = 121,
- SDLK_z = 122,
- SDLK_DELETE = 127,
- /* End of ASCII mapped keysyms */
+ SDLK_UNKNOWN = 0,
+ SDLK_FIRST = 0,
+ SDLK_BACKSPACE = 8,
+ SDLK_TAB = 9,
+ SDLK_CLEAR = 12,
+ SDLK_RETURN = 13,
+ SDLK_PAUSE = 19,
+ SDLK_ESCAPE = 27,
+ SDLK_SPACE = 32,
+ SDLK_EXCLAIM = 33,
+ SDLK_QUOTEDBL = 34,
+ SDLK_HASH = 35,
+ SDLK_DOLLAR = 36,
+ SDLK_AMPERSAND = 38,
+ SDLK_QUOTE = 39,
+ SDLK_LEFTPAREN = 40,
+ SDLK_RIGHTPAREN = 41,
+ SDLK_ASTERISK = 42,
+ SDLK_PLUS = 43,
+ SDLK_COMMA = 44,
+ SDLK_MINUS = 45,
+ SDLK_PERIOD = 46,
+ SDLK_SLASH = 47,
+ SDLK_0 = 48,
+ SDLK_1 = 49,
+ SDLK_2 = 50,
+ SDLK_3 = 51,
+ SDLK_4 = 52,
+ SDLK_5 = 53,
+ SDLK_6 = 54,
+ SDLK_7 = 55,
+ SDLK_8 = 56,
+ SDLK_9 = 57,
+ SDLK_COLON = 58,
+ SDLK_SEMICOLON = 59,
+ SDLK_LESS = 60,
+ SDLK_EQUALS = 61,
+ SDLK_GREATER = 62,
+ SDLK_QUESTION = 63,
+ SDLK_AT = 64,
+ /*
+ Skip uppercase letters
+ */
+ SDLK_LEFTBRACKET = 91,
+ SDLK_BACKSLASH = 92,
+ SDLK_RIGHTBRACKET = 93,
+ SDLK_CARET = 94,
+ SDLK_UNDERSCORE = 95,
+ SDLK_BACKQUOTE = 96,
+ SDLK_a = 97,
+ SDLK_b = 98,
+ SDLK_c = 99,
+ SDLK_d = 100,
+ SDLK_e = 101,
+ SDLK_f = 102,
+ SDLK_g = 103,
+ SDLK_h = 104,
+ SDLK_i = 105,
+ SDLK_j = 106,
+ SDLK_k = 107,
+ SDLK_l = 108,
+ SDLK_m = 109,
+ SDLK_n = 110,
+ SDLK_o = 111,
+ SDLK_p = 112,
+ SDLK_q = 113,
+ SDLK_r = 114,
+ SDLK_s = 115,
+ SDLK_t = 116,
+ SDLK_u = 117,
+ SDLK_v = 118,
+ SDLK_w = 119,
+ SDLK_x = 120,
+ SDLK_y = 121,
+ SDLK_z = 122,
+ SDLK_DELETE = 127,
+ /* End of ASCII mapped keysyms */
/*@}*/
- /** @name International keyboard syms */
+ /** @name International keyboard syms */
/*@{*/
- SDLK_WORLD_0 = 160, /* 0xA0 */
- SDLK_WORLD_1 = 161,
- SDLK_WORLD_2 = 162,
- SDLK_WORLD_3 = 163,
- SDLK_WORLD_4 = 164,
- SDLK_WORLD_5 = 165,
- SDLK_WORLD_6 = 166,
- SDLK_WORLD_7 = 167,
- SDLK_WORLD_8 = 168,
- SDLK_WORLD_9 = 169,
- SDLK_WORLD_10 = 170,
- SDLK_WORLD_11 = 171,
- SDLK_WORLD_12 = 172,
- SDLK_WORLD_13 = 173,
- SDLK_WORLD_14 = 174,
- SDLK_WORLD_15 = 175,
- SDLK_WORLD_16 = 176,
- SDLK_WORLD_17 = 177,
- SDLK_WORLD_18 = 178,
- SDLK_WORLD_19 = 179,
- SDLK_WORLD_20 = 180,
- SDLK_WORLD_21 = 181,
- SDLK_WORLD_22 = 182,
- SDLK_WORLD_23 = 183,
- SDLK_WORLD_24 = 184,
- SDLK_WORLD_25 = 185,
- SDLK_WORLD_26 = 186,
- SDLK_WORLD_27 = 187,
- SDLK_WORLD_28 = 188,
- SDLK_WORLD_29 = 189,
- SDLK_WORLD_30 = 190,
- SDLK_WORLD_31 = 191,
- SDLK_WORLD_32 = 192,
- SDLK_WORLD_33 = 193,
- SDLK_WORLD_34 = 194,
- SDLK_WORLD_35 = 195,
- SDLK_WORLD_36 = 196,
- SDLK_WORLD_37 = 197,
- SDLK_WORLD_38 = 198,
- SDLK_WORLD_39 = 199,
- SDLK_WORLD_40 = 200,
- SDLK_WORLD_41 = 201,
- SDLK_WORLD_42 = 202,
- SDLK_WORLD_43 = 203,
- SDLK_WORLD_44 = 204,
- SDLK_WORLD_45 = 205,
- SDLK_WORLD_46 = 206,
- SDLK_WORLD_47 = 207,
- SDLK_WORLD_48 = 208,
- SDLK_WORLD_49 = 209,
- SDLK_WORLD_50 = 210,
- SDLK_WORLD_51 = 211,
- SDLK_WORLD_52 = 212,
- SDLK_WORLD_53 = 213,
- SDLK_WORLD_54 = 214,
- SDLK_WORLD_55 = 215,
- SDLK_WORLD_56 = 216,
- SDLK_WORLD_57 = 217,
- SDLK_WORLD_58 = 218,
- SDLK_WORLD_59 = 219,
- SDLK_WORLD_60 = 220,
- SDLK_WORLD_61 = 221,
- SDLK_WORLD_62 = 222,
- SDLK_WORLD_63 = 223,
- SDLK_WORLD_64 = 224,
- SDLK_WORLD_65 = 225,
- SDLK_WORLD_66 = 226,
- SDLK_WORLD_67 = 227,
- SDLK_WORLD_68 = 228,
- SDLK_WORLD_69 = 229,
- SDLK_WORLD_70 = 230,
- SDLK_WORLD_71 = 231,
- SDLK_WORLD_72 = 232,
- SDLK_WORLD_73 = 233,
- SDLK_WORLD_74 = 234,
- SDLK_WORLD_75 = 235,
- SDLK_WORLD_76 = 236,
- SDLK_WORLD_77 = 237,
- SDLK_WORLD_78 = 238,
- SDLK_WORLD_79 = 239,
- SDLK_WORLD_80 = 240,
- SDLK_WORLD_81 = 241,
- SDLK_WORLD_82 = 242,
- SDLK_WORLD_83 = 243,
- SDLK_WORLD_84 = 244,
- SDLK_WORLD_85 = 245,
- SDLK_WORLD_86 = 246,
- SDLK_WORLD_87 = 247,
- SDLK_WORLD_88 = 248,
- SDLK_WORLD_89 = 249,
- SDLK_WORLD_90 = 250,
- SDLK_WORLD_91 = 251,
- SDLK_WORLD_92 = 252,
- SDLK_WORLD_93 = 253,
- SDLK_WORLD_94 = 254,
- SDLK_WORLD_95 = 255, /* 0xFF */
+ SDLK_WORLD_0 = 160, /* 0xA0 */
+ SDLK_WORLD_1 = 161,
+ SDLK_WORLD_2 = 162,
+ SDLK_WORLD_3 = 163,
+ SDLK_WORLD_4 = 164,
+ SDLK_WORLD_5 = 165,
+ SDLK_WORLD_6 = 166,
+ SDLK_WORLD_7 = 167,
+ SDLK_WORLD_8 = 168,
+ SDLK_WORLD_9 = 169,
+ SDLK_WORLD_10 = 170,
+ SDLK_WORLD_11 = 171,
+ SDLK_WORLD_12 = 172,
+ SDLK_WORLD_13 = 173,
+ SDLK_WORLD_14 = 174,
+ SDLK_WORLD_15 = 175,
+ SDLK_WORLD_16 = 176,
+ SDLK_WORLD_17 = 177,
+ SDLK_WORLD_18 = 178,
+ SDLK_WORLD_19 = 179,
+ SDLK_WORLD_20 = 180,
+ SDLK_WORLD_21 = 181,
+ SDLK_WORLD_22 = 182,
+ SDLK_WORLD_23 = 183,
+ SDLK_WORLD_24 = 184,
+ SDLK_WORLD_25 = 185,
+ SDLK_WORLD_26 = 186,
+ SDLK_WORLD_27 = 187,
+ SDLK_WORLD_28 = 188,
+ SDLK_WORLD_29 = 189,
+ SDLK_WORLD_30 = 190,
+ SDLK_WORLD_31 = 191,
+ SDLK_WORLD_32 = 192,
+ SDLK_WORLD_33 = 193,
+ SDLK_WORLD_34 = 194,
+ SDLK_WORLD_35 = 195,
+ SDLK_WORLD_36 = 196,
+ SDLK_WORLD_37 = 197,
+ SDLK_WORLD_38 = 198,
+ SDLK_WORLD_39 = 199,
+ SDLK_WORLD_40 = 200,
+ SDLK_WORLD_41 = 201,
+ SDLK_WORLD_42 = 202,
+ SDLK_WORLD_43 = 203,
+ SDLK_WORLD_44 = 204,
+ SDLK_WORLD_45 = 205,
+ SDLK_WORLD_46 = 206,
+ SDLK_WORLD_47 = 207,
+ SDLK_WORLD_48 = 208,
+ SDLK_WORLD_49 = 209,
+ SDLK_WORLD_50 = 210,
+ SDLK_WORLD_51 = 211,
+ SDLK_WORLD_52 = 212,
+ SDLK_WORLD_53 = 213,
+ SDLK_WORLD_54 = 214,
+ SDLK_WORLD_55 = 215,
+ SDLK_WORLD_56 = 216,
+ SDLK_WORLD_57 = 217,
+ SDLK_WORLD_58 = 218,
+ SDLK_WORLD_59 = 219,
+ SDLK_WORLD_60 = 220,
+ SDLK_WORLD_61 = 221,
+ SDLK_WORLD_62 = 222,
+ SDLK_WORLD_63 = 223,
+ SDLK_WORLD_64 = 224,
+ SDLK_WORLD_65 = 225,
+ SDLK_WORLD_66 = 226,
+ SDLK_WORLD_67 = 227,
+ SDLK_WORLD_68 = 228,
+ SDLK_WORLD_69 = 229,
+ SDLK_WORLD_70 = 230,
+ SDLK_WORLD_71 = 231,
+ SDLK_WORLD_72 = 232,
+ SDLK_WORLD_73 = 233,
+ SDLK_WORLD_74 = 234,
+ SDLK_WORLD_75 = 235,
+ SDLK_WORLD_76 = 236,
+ SDLK_WORLD_77 = 237,
+ SDLK_WORLD_78 = 238,
+ SDLK_WORLD_79 = 239,
+ SDLK_WORLD_80 = 240,
+ SDLK_WORLD_81 = 241,
+ SDLK_WORLD_82 = 242,
+ SDLK_WORLD_83 = 243,
+ SDLK_WORLD_84 = 244,
+ SDLK_WORLD_85 = 245,
+ SDLK_WORLD_86 = 246,
+ SDLK_WORLD_87 = 247,
+ SDLK_WORLD_88 = 248,
+ SDLK_WORLD_89 = 249,
+ SDLK_WORLD_90 = 250,
+ SDLK_WORLD_91 = 251,
+ SDLK_WORLD_92 = 252,
+ SDLK_WORLD_93 = 253,
+ SDLK_WORLD_94 = 254,
+ SDLK_WORLD_95 = 255, /* 0xFF */
/*@}*/
- /** @name Numeric keypad */
+ /** @name Numeric keypad */
/*@{*/
- SDLK_KP0 = 256,
- SDLK_KP1 = 257,
- SDLK_KP2 = 258,
- SDLK_KP3 = 259,
- SDLK_KP4 = 260,
- SDLK_KP5 = 261,
- SDLK_KP6 = 262,
- SDLK_KP7 = 263,
- SDLK_KP8 = 264,
- SDLK_KP9 = 265,
- SDLK_KP_PERIOD = 266,
- SDLK_KP_DIVIDE = 267,
- SDLK_KP_MULTIPLY = 268,
- SDLK_KP_MINUS = 269,
- SDLK_KP_PLUS = 270,
- SDLK_KP_ENTER = 271,
- SDLK_KP_EQUALS = 272,
+ SDLK_KP0 = 256,
+ SDLK_KP1 = 257,
+ SDLK_KP2 = 258,
+ SDLK_KP3 = 259,
+ SDLK_KP4 = 260,
+ SDLK_KP5 = 261,
+ SDLK_KP6 = 262,
+ SDLK_KP7 = 263,
+ SDLK_KP8 = 264,
+ SDLK_KP9 = 265,
+ SDLK_KP_PERIOD = 266,
+ SDLK_KP_DIVIDE = 267,
+ SDLK_KP_MULTIPLY = 268,
+ SDLK_KP_MINUS = 269,
+ SDLK_KP_PLUS = 270,
+ SDLK_KP_ENTER = 271,
+ SDLK_KP_EQUALS = 272,
/*@}*/
- /** @name Arrows + Home/End pad */
+ /** @name Arrows + Home/End pad */
/*@{*/
- SDLK_UP = 273,
- SDLK_DOWN = 274,
- SDLK_RIGHT = 275,
- SDLK_LEFT = 276,
- SDLK_INSERT = 277,
- SDLK_HOME = 278,
- SDLK_END = 279,
- SDLK_PAGEUP = 280,
- SDLK_PAGEDOWN = 281,
+ SDLK_UP = 273,
+ SDLK_DOWN = 274,
+ SDLK_RIGHT = 275,
+ SDLK_LEFT = 276,
+ SDLK_INSERT = 277,
+ SDLK_HOME = 278,
+ SDLK_END = 279,
+ SDLK_PAGEUP = 280,
+ SDLK_PAGEDOWN = 281,
/*@}*/
- /** @name Function keys */
+ /** @name Function keys */
/*@{*/
- SDLK_F1 = 282,
- SDLK_F2 = 283,
- SDLK_F3 = 284,
- SDLK_F4 = 285,
- SDLK_F5 = 286,
- SDLK_F6 = 287,
- SDLK_F7 = 288,
- SDLK_F8 = 289,
- SDLK_F9 = 290,
- SDLK_F10 = 291,
- SDLK_F11 = 292,
- SDLK_F12 = 293,
- SDLK_F13 = 294,
- SDLK_F14 = 295,
- SDLK_F15 = 296,
+ SDLK_F1 = 282,
+ SDLK_F2 = 283,
+ SDLK_F3 = 284,
+ SDLK_F4 = 285,
+ SDLK_F5 = 286,
+ SDLK_F6 = 287,
+ SDLK_F7 = 288,
+ SDLK_F8 = 289,
+ SDLK_F9 = 290,
+ SDLK_F10 = 291,
+ SDLK_F11 = 292,
+ SDLK_F12 = 293,
+ SDLK_F13 = 294,
+ SDLK_F14 = 295,
+ SDLK_F15 = 296,
/*@}*/
- /** @name Key state modifier keys */
+ /** @name Key state modifier keys */
/*@{*/
- SDLK_NUMLOCK = 300,
- SDLK_CAPSLOCK = 301,
- SDLK_SCROLLOCK = 302,
- SDLK_RSHIFT = 303,
- SDLK_LSHIFT = 304,
- SDLK_RCTRL = 305,
- SDLK_LCTRL = 306,
- SDLK_RALT = 307,
- SDLK_LALT = 308,
- SDLK_RMETA = 309,
- SDLK_LMETA = 310,
- SDLK_LSUPER = 311, /**< Left "Windows" key */
- SDLK_RSUPER = 312, /**< Right "Windows" key */
- SDLK_MODE = 313, /**< "Alt Gr" key */
- SDLK_COMPOSE = 314, /**< Multi-key compose key */
+ SDLK_NUMLOCK = 300,
+ SDLK_CAPSLOCK = 301,
+ SDLK_SCROLLOCK = 302,
+ SDLK_RSHIFT = 303,
+ SDLK_LSHIFT = 304,
+ SDLK_RCTRL = 305,
+ SDLK_LCTRL = 306,
+ SDLK_RALT = 307,
+ SDLK_LALT = 308,
+ SDLK_RMETA = 309,
+ SDLK_LMETA = 310,
+ SDLK_LSUPER = 311, /**< Left "Windows" key */
+ SDLK_RSUPER = 312, /**< Right "Windows" key */
+ SDLK_MODE = 313, /**< "Alt Gr" key */
+ SDLK_COMPOSE = 314, /**< Multi-key compose key */
/*@}*/
- /** @name Miscellaneous function keys */
+ /** @name Miscellaneous function keys */
/*@{*/
- SDLK_HELP = 315,
- SDLK_PRINT = 316,
- SDLK_SYSREQ = 317,
- SDLK_BREAK = 318,
- SDLK_MENU = 319,
- SDLK_POWER = 320, /**< Power Macintosh power key */
- SDLK_EURO = 321, /**< Some european keyboards */
- SDLK_UNDO = 322, /**< Atari keyboard has Undo */
+ SDLK_HELP = 315,
+ SDLK_PRINT = 316,
+ SDLK_SYSREQ = 317,
+ SDLK_BREAK = 318,
+ SDLK_MENU = 319,
+ SDLK_POWER = 320, /**< Power Macintosh power key */
+ SDLK_EURO = 321, /**< Some european keyboards */
+ SDLK_UNDO = 322, /**< Atari keyboard has Undo */
/*@}*/
- /* Add any other keys here */
+ /* Add any other keys here */
- SDLK_LAST
+ SDLK_LAST
} SDLKey;
/** Enumeration of valid key mods (possibly OR'd together) */
typedef enum {
- KMOD_NONE = 0x0000,
- KMOD_LSHIFT= 0x0001,
- KMOD_RSHIFT= 0x0002,
- KMOD_LCTRL = 0x0040,
- KMOD_RCTRL = 0x0080,
- KMOD_LALT = 0x0100,
- KMOD_RALT = 0x0200,
- KMOD_LMETA = 0x0400,
- KMOD_RMETA = 0x0800,
- KMOD_NUM = 0x1000,
- KMOD_CAPS = 0x2000,
- KMOD_MODE = 0x4000,
- KMOD_RESERVED = 0x8000
+ KMOD_NONE = 0x0000,
+ KMOD_LSHIFT= 0x0001,
+ KMOD_RSHIFT= 0x0002,
+ KMOD_LCTRL = 0x0040,
+ KMOD_RCTRL = 0x0080,
+ KMOD_LALT = 0x0100,
+ KMOD_RALT = 0x0200,
+ KMOD_LMETA = 0x0400,
+ KMOD_RMETA = 0x0800,
+ KMOD_NUM = 0x1000,
+ KMOD_CAPS = 0x2000,
+ KMOD_MODE = 0x4000,
+ KMOD_RESERVED = 0x8000
} SDLMod;
-#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
-#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
-#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
-#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
+#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
+#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
#endif /* _SDL_keysym_h */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_loadso.h
--- a/misc/winutils/include/SDL_loadso.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_loadso.h Tue Jan 21 22:43:06 2014 +0100
@@ -25,7 +25,7 @@
*/
/** @file SDL_loadso.h
- * Some things to keep in mind:
+ * Some things to keep in mind:
* - These functions only work on C function names. Other languages may
* have name mangling and intrinsic language support that varies from
* compiler to compiler.
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_main.h
--- a/misc/winutils/include/SDL_main.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_main.h Tue Jan 21 22:43:06 2014 +0100
@@ -35,7 +35,7 @@
defined(__SYMBIAN32__) || defined(QWS)
#ifdef __cplusplus
-#define C_LINKAGE "C"
+#define C_LINKAGE "C"
#else
#define C_LINKAGE
#endif /* __cplusplus */
@@ -46,12 +46,12 @@
* #ifdef __cplusplus
* extern "C"
* #endif
- * int main(int argc, char *argv[])
- * {
- * }
+ * int main(int argc, char *argv[])
+ * {
+ * }
* @endcode
*/
-#define main SDL_main
+#define main SDL_main
/** The prototype for the application's main() function */
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_mixer.h
--- a/misc/winutils/include/SDL_mixer.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_mixer.h Tue Jan 21 22:43:06 2014 +0100
@@ -38,25 +38,25 @@
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
-#define SDL_MIXER_MAJOR_VERSION 1
-#define SDL_MIXER_MINOR_VERSION 2
+#define SDL_MIXER_MAJOR_VERSION 1
+#define SDL_MIXER_MINOR_VERSION 2
#define SDL_MIXER_PATCHLEVEL 12
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_mixer library.
*/
-#define SDL_MIXER_VERSION(X) \
-{ \
- (X)->major = SDL_MIXER_MAJOR_VERSION; \
- (X)->minor = SDL_MIXER_MINOR_VERSION; \
- (X)->patch = SDL_MIXER_PATCHLEVEL; \
+#define SDL_MIXER_VERSION(X) \
+{ \
+ (X)->major = SDL_MIXER_MAJOR_VERSION; \
+ (X)->minor = SDL_MIXER_MINOR_VERSION; \
+ (X)->patch = SDL_MIXER_PATCHLEVEL; \
}
/* Backwards compatibility */
-#define MIX_MAJOR_VERSION SDL_MIXER_MAJOR_VERSION
-#define MIX_MINOR_VERSION SDL_MIXER_MINOR_VERSION
-#define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL
-#define MIX_VERSION(X) SDL_MIXER_VERSION(X)
+#define MIX_MAJOR_VERSION SDL_MIXER_MAJOR_VERSION
+#define MIX_MINOR_VERSION SDL_MIXER_MINOR_VERSION
+#define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL
+#define MIX_VERSION(X) SDL_MIXER_VERSION(X)
/* This function gets the version of the dynamically linked SDL_mixer library.
it should NOT be used to fill a version structure, instead you should
@@ -85,45 +85,45 @@
/* The default mixer has 8 simultaneous mixing channels */
#ifndef MIX_CHANNELS
-#define MIX_CHANNELS 8
+#define MIX_CHANNELS 8
#endif
/* Good default values for a PC soundcard */
-#define MIX_DEFAULT_FREQUENCY 22050
+#define MIX_DEFAULT_FREQUENCY 22050
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define MIX_DEFAULT_FORMAT AUDIO_S16LSB
+#define MIX_DEFAULT_FORMAT AUDIO_S16LSB
#else
-#define MIX_DEFAULT_FORMAT AUDIO_S16MSB
+#define MIX_DEFAULT_FORMAT AUDIO_S16MSB
#endif
-#define MIX_DEFAULT_CHANNELS 2
-#define MIX_MAX_VOLUME 128 /* Volume of a chunk */
+#define MIX_DEFAULT_CHANNELS 2
+#define MIX_MAX_VOLUME 128 /* Volume of a chunk */
/* The internal format for an audio chunk */
typedef struct Mix_Chunk {
- int allocated;
- Uint8 *abuf;
- Uint32 alen;
- Uint8 volume; /* Per-sample volume, 0-128 */
+ int allocated;
+ Uint8 *abuf;
+ Uint32 alen;
+ Uint8 volume; /* Per-sample volume, 0-128 */
} Mix_Chunk;
/* The different fading types supported */
typedef enum {
- MIX_NO_FADING,
- MIX_FADING_OUT,
- MIX_FADING_IN
+ MIX_NO_FADING,
+ MIX_FADING_OUT,
+ MIX_FADING_IN
} Mix_Fading;
typedef enum {
- MUS_NONE,
- MUS_CMD,
- MUS_WAV,
- MUS_MOD,
- MUS_MID,
- MUS_OGG,
- MUS_MP3,
- MUS_MP3_MAD,
- MUS_FLAC,
- MUS_MODPLUG
+ MUS_NONE,
+ MUS_CMD,
+ MUS_WAV,
+ MUS_MOD,
+ MUS_MID,
+ MUS_OGG,
+ MUS_MP3,
+ MUS_MP3_MAD,
+ MUS_FLAC,
+ MUS_MODPLUG
} Mix_MusicType;
/* The internal format for a music chunk interpreted via mikmod */
@@ -131,7 +131,7 @@
/* Open the mixer with a certain audio format */
extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels,
- int chunksize);
+ int chunksize);
/* Dynamically change the number of channels managed by the mixer.
If decreasing the number of channels, the upper channels are
@@ -147,7 +147,7 @@
/* Load a wave file or a music (.mod .s3m .it .xm) file */
extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
-#define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
+#define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);
/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
@@ -219,9 +219,9 @@
/*
* Add your own callback when a channel has finished playing. NULL
- * to disable callback. The callback may be called from the mixer's audio
+ * to disable callback. The callback may be called from the mixer's audio
* callback or it could be called as a result of Mix_HaltChannel(), etc.
- * do not call SDL_LockAudio() from this callback; you will either be
+ * do not call SDL_LockAudio() from this callback; you will either be
* inside the audio callback, or SDL_mixer will explicitly lock the audio
* before calling your callback.
*/
@@ -302,7 +302,7 @@
*
* After all these effects have finished processing, the callback registered
* through Mix_SetPostMix() runs, and then the stream goes to the audio
- * device.
+ * device.
*
* DO NOT EVER call SDL_LockAudio() from your callback function!
*
@@ -310,7 +310,7 @@
* Error messages can be retrieved from Mix_GetError().
*/
extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f,
- Mix_EffectDone_t d, void *arg);
+ Mix_EffectDone_t d, void *arg);
/* You may not need to call this explicitly, unless you need to stop an
@@ -590,7 +590,7 @@
/* Set the current position in the music stream.
This returns 0 if successful, or -1 if it failed or isn't implemented.
This function is only implemented for MOD music formats (set pattern
- order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set
+ order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set
position in seconds), at the moment.
*/
extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position);
@@ -622,8 +622,8 @@
extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
/* We'll use SDL for reporting errors */
-#define Mix_SetError SDL_SetError
-#define Mix_GetError SDL_GetError
+#define Mix_SetError SDL_SetError
+#define Mix_GetError SDL_GetError
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_mouse.h
--- a/misc/winutils/include/SDL_mouse.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_mouse.h Tue Jan 21 22:43:06 2014 +0100
@@ -37,14 +37,14 @@
extern "C" {
#endif
-typedef struct WMcursor WMcursor; /**< Implementation dependent */
+typedef struct WMcursor WMcursor; /**< Implementation dependent */
typedef struct SDL_Cursor {
- SDL_Rect area; /**< The area of the mouse cursor */
- Sint16 hot_x, hot_y; /**< The "tip" of the cursor */
- Uint8 *data; /**< B/W cursor data */
- Uint8 *mask; /**< B/W cursor mask */
- Uint8 *save[2]; /**< Place to save cursor area */
- WMcursor *wm_cursor; /**< Window-manager cursor */
+ SDL_Rect area; /**< The area of the mouse cursor */
+ Sint16 hot_x, hot_y; /**< The "tip" of the cursor */
+ Uint8 *data; /**< B/W cursor data */
+ Uint8 *mask; /**< B/W cursor mask */
+ Uint8 *save[2]; /**< Place to save cursor area */
+ WMcursor *wm_cursor; /**< Window-manager cursor */
} SDL_Cursor;
/* Function prototypes */
@@ -83,11 +83,11 @@
* Cursors created with this function must be freed with SDL_FreeCursor().
*/
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
- (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+ (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
/**
* Set the currently active cursor to the specified one.
- * If the cursor is currently visible, the change will be immediately
+ * If the cursor is currently visible, the change will be immediately
* represented on the display.
*/
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
@@ -113,25 +113,25 @@
/*@{*/
/** Used as a mask when testing buttons in buttonstate
- * Button 1: Left mouse button
- * Button 2: Middle mouse button
- * Button 3: Right mouse button
- * Button 4: Mouse wheel up (may also be a real button)
- * Button 5: Mouse wheel down (may also be a real button)
+ * Button 1: Left mouse button
+ * Button 2: Middle mouse button
+ * Button 3: Right mouse button
+ * Button 4: Mouse wheel up (may also be a real button)
+ * Button 5: Mouse wheel down (may also be a real button)
*/
-#define SDL_BUTTON(X) (1 << ((X)-1))
-#define SDL_BUTTON_LEFT 1
-#define SDL_BUTTON_MIDDLE 2
-#define SDL_BUTTON_RIGHT 3
-#define SDL_BUTTON_WHEELUP 4
-#define SDL_BUTTON_WHEELDOWN 5
-#define SDL_BUTTON_X1 6
-#define SDL_BUTTON_X2 7
-#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
-#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
-#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
-#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
-#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
+#define SDL_BUTTON(X) (1 << ((X)-1))
+#define SDL_BUTTON_LEFT 1
+#define SDL_BUTTON_MIDDLE 2
+#define SDL_BUTTON_RIGHT 3
+#define SDL_BUTTON_WHEELUP 4
+#define SDL_BUTTON_WHEELDOWN 5
+#define SDL_BUTTON_X1 6
+#define SDL_BUTTON_X2 7
+#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
+#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
+#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
+#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
+#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
/*@}*/
/* Ends C function definitions when using C++ */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_mutex.h
--- a/misc/winutils/include/SDL_mutex.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_mutex.h Tue Jan 21 22:43:06 2014 +0100
@@ -41,10 +41,10 @@
/** Synchronization functions which can time out return this value
* if they time out.
*/
-#define SDL_MUTEX_TIMEDOUT 1
+#define SDL_MUTEX_TIMEDOUT 1
/** This is the timeout value which corresponds to never time out */
-#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
+#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -58,13 +58,13 @@
/** Create a mutex, initialized unlocked */
extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
-#define SDL_LockMutex(m) SDL_mutexP(m)
+#define SDL_LockMutex(m) SDL_mutexP(m)
/** Lock the mutex
* @return 0, or -1 on error
*/
extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
-#define SDL_UnlockMutex(m) SDL_mutexV(m)
+#define SDL_UnlockMutex(m) SDL_mutexV(m)
/** Unlock the mutex
* @return 0, or -1 on error
*
@@ -93,7 +93,7 @@
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
/**
- * This function suspends the calling thread until the semaphore pointed
+ * This function suspends the calling thread until the semaphore pointed
* to by sem has a positive count. It then atomically decreases the semaphore
* count.
*/
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_name.h
--- a/misc/winutils/include/SDL_name.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_name.h Tue Jan 21 22:43:06 2014 +0100
@@ -6,6 +6,6 @@
#define NeedFunctionPrototypes 1
#endif
-#define SDL_NAME(X) SDL_##X
+#define SDL_NAME(X) SDL_##X
#endif /* _SDLname_h_ */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_net.h
--- a/misc/winutils/include/SDL_net.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_net.h Tue Jan 21 22:43:06 2014 +0100
@@ -38,18 +38,18 @@
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
-#define SDL_NET_MAJOR_VERSION 1
-#define SDL_NET_MINOR_VERSION 2
-#define SDL_NET_PATCHLEVEL 8
+#define SDL_NET_MAJOR_VERSION 1
+#define SDL_NET_MINOR_VERSION 2
+#define SDL_NET_PATCHLEVEL 8
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_net library.
*/
-#define SDL_NET_VERSION(X) \
-{ \
- (X)->major = SDL_NET_MAJOR_VERSION; \
- (X)->minor = SDL_NET_MINOR_VERSION; \
- (X)->patch = SDL_NET_PATCHLEVEL; \
+#define SDL_NET_VERSION(X) \
+{ \
+ (X)->major = SDL_NET_MAJOR_VERSION; \
+ (X)->minor = SDL_NET_MINOR_VERSION; \
+ (X)->patch = SDL_NET_PATCHLEVEL; \
}
/* This function gets the version of the dynamically linked SDL_net library.
@@ -70,8 +70,8 @@
/***********************************************************************/
typedef struct {
- Uint32 host; /* 32-bit IPv4 host address */
- Uint16 port; /* 16-bit protocol port */
+ Uint32 host; /* 32-bit IPv4 host address */
+ Uint16 port; /* 16-bit protocol port */
} IPaddress;
/* Resolve a host name and port to an IP address in network form.
@@ -81,13 +81,13 @@
If 'host' is NULL, the resolved host will be set to INADDR_ANY.
*/
#ifndef INADDR_ANY
-#define INADDR_ANY 0x00000000
+#define INADDR_ANY 0x00000000
#endif
#ifndef INADDR_NONE
-#define INADDR_NONE 0xFFFFFFFF
+#define INADDR_NONE 0xFFFFFFFF
#endif
#ifndef INADDR_BROADCAST
-#define INADDR_BROADCAST 0xFFFFFFFF
+#define INADDR_BROADCAST 0xFFFFFFFF
#endif
extern DECLSPEC int SDLCALL SDLNet_ResolveHost(IPaddress *address, const char *host, Uint16 port);
@@ -113,7 +113,7 @@
If ip.host is INADDR_NONE or INADDR_ANY, this creates a local server
socket on the given port, otherwise a TCP connection to the remote
host and port is attempted. The address passed in should already be
- swapped to network byte order (addresses returned from
+ swapped to network byte order (addresses returned from
SDLNet_ResolveHost() are already in the correct form).
The newly created socket is returned, or NULL if there was an error.
*/
@@ -135,7 +135,7 @@
closed, or an unknown socket error occurred.
*/
extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket sock, const void *data,
- int len);
+ int len);
/* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
and store them in the buffer pointed to by 'data'.
@@ -154,18 +154,18 @@
/***********************************************************************/
/* The maximum channels on a a UDP socket */
-#define SDLNET_MAX_UDPCHANNELS 32
+#define SDLNET_MAX_UDPCHANNELS 32
/* The maximum addresses bound to a single UDP socket channel */
-#define SDLNET_MAX_UDPADDRESSES 4
+#define SDLNET_MAX_UDPADDRESSES 4
typedef struct _UDPsocket *UDPsocket;
typedef struct {
- int channel; /* The src/dst channel of the packet */
- Uint8 *data; /* The packet data */
- int len; /* The length of the packet data */
- int maxlen; /* The size of the data buffer */
- int status; /* packet status after sending */
- IPaddress address; /* The source/dest address of an incoming/outgoing packet */
+ int channel; /* The src/dst channel of the packet */
+ Uint8 *data; /* The packet data */
+ int len; /* The length of the packet data */
+ int maxlen; /* The size of the data buffer */
+ int status; /* packet status after sending */
+ IPaddress address; /* The source/dest address of an incoming/outgoing packet */
} UDPpacket;
/* Allocate/resize/free a single UDP packet 'size' bytes long.
@@ -210,7 +210,7 @@
/* Unbind all addresses from the given channel */
extern DECLSPEC void SDLCALL SDLNet_UDP_Unbind(UDPsocket sock, int channel);
-/* Get the primary IP address of the remote system associated with the
+/* Get the primary IP address of the remote system associated with the
socket and channel. If the channel is -1, then the primary IP port
of the UDP socket is returned -- this is only meaningful for sockets
opened with a specific port.
@@ -221,7 +221,7 @@
/* Send a vector of packets to the the channels specified within the packet.
If the channel specified in the packet is -1, the packet will be sent to
the address in the 'src' member of the packet.
- Each packet will be updated with the status of the packet after it has
+ Each packet will be updated with the status of the packet after it has
been sent, -1 if the packet send failed.
This function returns the number of packets sent.
*/
@@ -277,7 +277,7 @@
/* Any network socket can be safely cast to this socket type */
typedef struct _SDLNet_GenericSocket {
- int ready;
+ int ready;
} *SDLNet_GenericSocket;
/* Allocate a socket set for use with SDLNet_CheckSockets()
@@ -288,23 +288,23 @@
/* Add a socket to a set of sockets to be checked for available data */
#define SDLNet_TCP_AddSocket(set, sock) \
- SDLNet_AddSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
+ SDLNet_AddSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
#define SDLNet_UDP_AddSocket(set, sock) \
- SDLNet_AddSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
+ SDLNet_AddSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
extern DECLSPEC int SDLCALL SDLNet_AddSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock);
/* Remove a socket from a set of sockets to be checked for available data */
#define SDLNet_TCP_DelSocket(set, sock) \
- SDLNet_DelSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
+ SDLNet_DelSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
#define SDLNet_UDP_DelSocket(set, sock) \
- SDLNet_DelSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
+ SDLNet_DelSocket(set, SDL_reinterpret_cast(SDLNet_GenericSocket, sock))
extern DECLSPEC int SDLCALL SDLNet_DelSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock);
/* This function checks to see if data is available for reading on the
given set of sockets. If 'timeout' is 0, it performs a quick poll,
otherwise the function returns when either data is available for
reading, or the timeout in milliseconds has elapsed, which ever occurs
- first. This function returns the number of sockets ready for reading,
+ first. This function returns the number of sockets ready for reading,
or -1 if there was an error with the select() system call.
*/
extern DECLSPEC int SDLCALL SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout);
@@ -314,7 +314,7 @@
for reading.
*/
#define SDLNet_SocketReady(sock) \
- ((sock != NULL) && SDL_reinterpret_cast(SDLNet_GenericSocket, sock)->ready)
+ ((sock != NULL) && SDL_reinterpret_cast(SDLNet_GenericSocket, sock)->ready)
/* Free a set of sockets allocated by SDL_NetAllocSocketSet() */
extern DECLSPEC void SDLCALL SDLNet_FreeSocketSet(SDLNet_SocketSet set);
@@ -337,8 +337,8 @@
/***********************************************************************/
/* We'll use SDL's functions for error reporting */
-#define SDLNet_SetError SDL_SetError
-#define SDLNet_GetError SDL_GetError
+#define SDLNet_SetError SDL_SetError
+#define SDLNet_GetError SDL_GetError
/* I'm eventually going to try to disentangle SDL_net from SDL, thus making
SDL_net an independent X-platform networking toolkit. Not today though....
@@ -352,91 +352,91 @@
/* Warning, some systems have data access alignment restrictions */
#if defined(sparc) || defined(mips)
-#define SDL_DATA_ALIGNED 1
+#define SDL_DATA_ALIGNED 1
#endif
#ifndef SDL_DATA_ALIGNED
-#define SDL_DATA_ALIGNED 0
+#define SDL_DATA_ALIGNED 0
#endif
/* Write a 16 bit value to network packet buffer */
#if !SDL_DATA_ALIGNED
-#define SDLNet_Write16(value, areap) \
- (*SDL_reinterpret_cast(Uint16 *, areap) = SDL_SwapBE16(value))
+#define SDLNet_Write16(value, areap) \
+ (*SDL_reinterpret_cast(Uint16 *, areap) = SDL_SwapBE16(value))
#else
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define SDLNet_Write16(value, areap) \
-do \
-{ \
- Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
- area[0] = (value >> 8) & 0xFF; \
- area[1] = value & 0xFF; \
+#define SDLNet_Write16(value, areap) \
+do \
+{ \
+ Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
+ area[0] = (value >> 8) & 0xFF; \
+ area[1] = value & 0xFF; \
} while ( 0 )
#else
-#define SDLNet_Write16(value, areap) \
-do \
-{ \
- Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
- area[1] = (value >> 8) & 0xFF; \
- area[0] = value & 0xFF; \
+#define SDLNet_Write16(value, areap) \
+do \
+{ \
+ Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
+ area[1] = (value >> 8) & 0xFF; \
+ area[0] = value & 0xFF; \
} while ( 0 )
#endif
#endif /* !SDL_DATA_ALIGNED */
/* Write a 32 bit value to network packet buffer */
#if !SDL_DATA_ALIGNED
-#define SDLNet_Write32(value, areap) \
- *SDL_reinterpret_cast(Uint32 *, areap) = SDL_SwapBE32(value);
+#define SDLNet_Write32(value, areap) \
+ *SDL_reinterpret_cast(Uint32 *, areap) = SDL_SwapBE32(value);
#else
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define SDLNet_Write32(value, areap) \
-do \
-{ \
- Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
- area[0] = (value >> 24) & 0xFF; \
- area[1] = (value >> 16) & 0xFF; \
- area[2] = (value >> 8) & 0xFF; \
- area[3] = value & 0xFF; \
+#define SDLNet_Write32(value, areap) \
+do \
+{ \
+ Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
+ area[0] = (value >> 24) & 0xFF; \
+ area[1] = (value >> 16) & 0xFF; \
+ area[2] = (value >> 8) & 0xFF; \
+ area[3] = value & 0xFF; \
} while ( 0 )
#else
-#define SDLNet_Write32(value, areap) \
-do \
-{ \
- Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
- area[3] = (value >> 24) & 0xFF; \
- area[2] = (value >> 16) & 0xFF; \
- area[1] = (value >> 8) & 0xFF; \
- area[0] = value & 0xFF; \
+#define SDLNet_Write32(value, areap) \
+do \
+{ \
+ Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
+ area[3] = (value >> 24) & 0xFF; \
+ area[2] = (value >> 16) & 0xFF; \
+ area[1] = (value >> 8) & 0xFF; \
+ area[0] = value & 0xFF; \
} while ( 0 )
#endif
#endif /* !SDL_DATA_ALIGNED */
/* Read a 16 bit value from network packet buffer */
#if !SDL_DATA_ALIGNED
-#define SDLNet_Read16(areap) \
- (SDL_SwapBE16(*SDL_reinterpret_cast(Uint16 *, areap)))
+#define SDLNet_Read16(areap) \
+ (SDL_SwapBE16(*SDL_reinterpret_cast(Uint16 *, areap)))
#else
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define SDLNet_Read16(areap) \
- (((SDL_reinterpret_cast(Uint8 *, areap))[0] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[1] << 0)
+#define SDLNet_Read16(areap) \
+ (((SDL_reinterpret_cast(Uint8 *, areap))[0] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[1] << 0)
#else
-#define SDLNet_Read16(areap) \
- (((SDL_reinterpret_cast(Uint8 *, areap))[1] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[0] << 0)
+#define SDLNet_Read16(areap) \
+ (((SDL_reinterpret_cast(Uint8 *, areap))[1] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[0] << 0)
#endif
#endif /* !SDL_DATA_ALIGNED */
/* Read a 32 bit value from network packet buffer */
#if !SDL_DATA_ALIGNED
-#define SDLNet_Read32(areap) \
- (SDL_SwapBE32(*SDL_reinterpret_cast(Uint32 *, areap)))
+#define SDLNet_Read32(areap) \
+ (SDL_SwapBE32(*SDL_reinterpret_cast(Uint32 *, areap)))
#else
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define SDLNet_Read32(areap) \
- (((SDL_reinterpret_cast(Uint8 *, areap))[0] << 24) | ((SDL_reinterpret_cast(Uint8 *, areap))[1] << 16) | \
- ((SDL_reinterpret_cast(Uint8 *, areap))[2] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[3] << 0)
+#define SDLNet_Read32(areap) \
+ (((SDL_reinterpret_cast(Uint8 *, areap))[0] << 24) | ((SDL_reinterpret_cast(Uint8 *, areap))[1] << 16) | \
+ ((SDL_reinterpret_cast(Uint8 *, areap))[2] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[3] << 0)
#else
-#define SDLNet_Read32(areap) \
- (((SDL_reinterpret_cast(Uint8 *, areap))[3] << 24) | ((SDL_reinterpret_cast(Uint8 *, areap))[2] << 16) | \
- ((SDL_reinterpret_cast(Uint8 *, areap))[1] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[0] << 0)
+#define SDLNet_Read32(areap) \
+ (((SDL_reinterpret_cast(Uint8 *, areap))[3] << 24) | ((SDL_reinterpret_cast(Uint8 *, areap))[2] << 16) | \
+ ((SDL_reinterpret_cast(Uint8 *, areap))[1] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[0] << 0)
#endif
#endif /* !SDL_DATA_ALIGNED */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_opengl.h
--- a/misc/winutils/include/SDL_opengl.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_opengl.h Tue Jan 21 22:43:06 2014 +0100
@@ -29,7 +29,7 @@
#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
-#define NOMINMAX /* Don't defined min() and max() */
+#define NOMINMAX /* Don't defined min() and max() */
#endif
#include
#endif
@@ -37,14 +37,14 @@
#define __glext_h_ /* Don't let gl.h include glext.h */
#endif
#if defined(__MACOSX__)
-#include /* Header File For The OpenGL Library */
-#include /* Header File For The GLU Library */
+#include /* Header File For The OpenGL Library */
+#include /* Header File For The GLU Library */
#elif defined(__MACOS__)
-#include /* Header File For The OpenGL Library */
-#include /* Header File For The GLU Library */
+#include /* Header File For The OpenGL Library */
+#include /* Header File For The GLU Library */
#else
-#include /* Header File For The OpenGL Library */
-#include /* Header File For The GLU Library */
+#include /* Header File For The OpenGL Library */
+#include /* Header File For The GLU Library */
#endif
#ifndef NO_SDL_GLEXT
#undef __glext_h_
@@ -72,21 +72,21 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
+**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
@@ -3103,7 +3103,7 @@
#include
#ifndef GL_VERSION_2_0
/* GL type for program/shader text */
-typedef char GLchar; /* native character */
+typedef char GLchar; /* native character */
#endif
#ifndef GL_VERSION_1_5
@@ -3130,11 +3130,11 @@
#ifndef GL_ARB_shader_objects
/* GL types for handling shader object handles and program/shader text */
-typedef char GLcharARB; /* native character */
+typedef char GLcharARB; /* native character */
#if defined(__APPLE__)
-typedef void *GLhandleARB; /* shader object handle */
+typedef void *GLhandleARB; /* shader object handle */
#else
-typedef unsigned int GLhandleARB; /* shader object handle */
+typedef unsigned int GLhandleARB; /* shader object handle */
#endif
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_platform.h
--- a/misc/winutils/include/SDL_platform.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_platform.h Tue Jan 21 22:43:06 2014 +0100
@@ -29,11 +29,11 @@
#if defined(_AIX)
#undef __AIX__
-#define __AIX__ 1
+#define __AIX__ 1
#endif
#if defined(__BEOS__)
#undef __BEOS__
-#define __BEOS__ 1
+#define __BEOS__ 1
#endif
#if defined(__HAIKU__)
#undef __HAIKU__
@@ -41,70 +41,70 @@
#endif
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
#undef __BSDI__
-#define __BSDI__ 1
+#define __BSDI__ 1
#endif
#if defined(_arch_dreamcast)
#undef __DREAMCAST__
-#define __DREAMCAST__ 1
+#define __DREAMCAST__ 1
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
#undef __FREEBSD__
-#define __FREEBSD__ 1
+#define __FREEBSD__ 1
#endif
#if defined(__HAIKU__)
#undef __HAIKU__
-#define __HAIKU__ 1
+#define __HAIKU__ 1
#endif
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
#undef __HPUX__
-#define __HPUX__ 1
+#define __HPUX__ 1
#endif
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
#undef __IRIX__
-#define __IRIX__ 1
+#define __IRIX__ 1
#endif
#if defined(linux) || defined(__linux) || defined(__linux__)
#undef __LINUX__
-#define __LINUX__ 1
+#define __LINUX__ 1
#endif
#if defined(__APPLE__)
#undef __MACOSX__
-#define __MACOSX__ 1
+#define __MACOSX__ 1
#elif defined(macintosh)
#undef __MACOS__
-#define __MACOS__ 1
+#define __MACOS__ 1
#endif
#if defined(__NetBSD__)
#undef __NETBSD__
-#define __NETBSD__ 1
+#define __NETBSD__ 1
#endif
#if defined(__OpenBSD__)
#undef __OPENBSD__
-#define __OPENBSD__ 1
+#define __OPENBSD__ 1
#endif
#if defined(__OS2__)
#undef __OS2__
-#define __OS2__ 1
+#define __OS2__ 1
#endif
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
#undef __OSF__
-#define __OSF__ 1
+#define __OSF__ 1
#endif
#if defined(__QNXNTO__)
#undef __QNXNTO__
-#define __QNXNTO__ 1
+#define __QNXNTO__ 1
#endif
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
#undef __RISCOS__
-#define __RISCOS__ 1
+#define __RISCOS__ 1
#endif
#if defined(__SVR4)
#undef __SOLARIS__
-#define __SOLARIS__ 1
+#define __SOLARIS__ 1
#endif
#if defined(WIN32) || defined(_WIN32)
#undef __WIN32__
-#define __WIN32__ 1
+#define __WIN32__ 1
#endif
#endif /* _SDL_platform_h */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_quit.h
--- a/misc/winutils/include/SDL_quit.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_quit.h Tue Jan 21 22:43:06 2014 +0100
@@ -34,7 +34,7 @@
* An SDL_QUITEVENT is generated when the user tries to close the application
* window. If it is ignored or filtered out, the window will remain open.
* If it is not ignored or filtered, it is queued normally and the window
- * is allowed to close. When the window is closed, screen updates will
+ * is allowed to close. When the window is closed, screen updates will
* complete, but have no effect.
*
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
@@ -46,7 +46,7 @@
*/
/** @file SDL_quit.h
- * There are no functions directly affecting the quit event
+ * There are no functions directly affecting the quit event
*/
#define SDL_QuitRequested() \
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_rwops.h
--- a/misc/winutils/include/SDL_rwops.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_rwops.h Tue Jan 21 22:43:06 2014 +0100
@@ -40,55 +40,55 @@
/** This is the read/write operation structure -- very basic */
typedef struct SDL_RWops {
- /** Seek to 'offset' relative to whence, one of stdio's whence values:
- * SEEK_SET, SEEK_CUR, SEEK_END
- * Returns the final offset in the data source.
- */
- int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
+ /** Seek to 'offset' relative to whence, one of stdio's whence values:
+ * SEEK_SET, SEEK_CUR, SEEK_END
+ * Returns the final offset in the data source.
+ */
+ int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
- /** Read up to 'maxnum' objects each of size 'size' from the data
- * source to the area pointed at by 'ptr'.
- * Returns the number of objects read, or -1 if the read failed.
- */
- int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
+ /** Read up to 'maxnum' objects each of size 'size' from the data
+ * source to the area pointed at by 'ptr'.
+ * Returns the number of objects read, or -1 if the read failed.
+ */
+ int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
- /** Write exactly 'num' objects each of size 'objsize' from the area
- * pointed at by 'ptr' to data source.
- * Returns 'num', or -1 if the write failed.
- */
- int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
+ /** Write exactly 'num' objects each of size 'objsize' from the area
+ * pointed at by 'ptr' to data source.
+ * Returns 'num', or -1 if the write failed.
+ */
+ int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
- /** Close and free an allocated SDL_FSops structure */
- int (SDLCALL *close)(struct SDL_RWops *context);
+ /** Close and free an allocated SDL_FSops structure */
+ int (SDLCALL *close)(struct SDL_RWops *context);
- Uint32 type;
- union {
+ Uint32 type;
+ union {
#if defined(__WIN32__) && !defined(__SYMBIAN32__)
- struct {
- int append;
- void *h;
- struct {
- void *data;
- int size;
- int left;
- } buffer;
- } win32io;
+ struct {
+ int append;
+ void *h;
+ struct {
+ void *data;
+ int size;
+ int left;
+ } buffer;
+ } win32io;
#endif
-#ifdef HAVE_STDIO_H
- struct {
- int autoclose;
- FILE *fp;
- } stdio;
+#ifdef HAVE_STDIO_H
+ struct {
+ int autoclose;
+ FILE *fp;
+ } stdio;
#endif
- struct {
- Uint8 *base;
- Uint8 *here;
- Uint8 *stop;
- } mem;
- struct {
- void *data1;
- } unknown;
- } hidden;
+ struct {
+ Uint8 *base;
+ Uint8 *here;
+ Uint8 *stop;
+ } mem;
+ struct {
+ void *data1;
+ } unknown;
+ } hidden;
} SDL_RWops;
@@ -112,18 +112,18 @@
/** @name Seek Reference Points */
/*@{*/
-#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
-#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
-#define RW_SEEK_END 2 /**< Seek relative to the end of data */
+#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
+#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
+#define RW_SEEK_END 2 /**< Seek relative to the end of data */
/*@}*/
/** @name Macros to easily read and write from an SDL_RWops structure */
/*@{*/
-#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
-#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
-#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
-#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
-#define SDL_RWclose(ctx) (ctx)->close(ctx)
+#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
+#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
+#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
+#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
+#define SDL_RWclose(ctx) (ctx)->close(ctx)
/*@}*/
/** @name Read an item of the specified endianness and return in native format */
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_stdinc.h
--- a/misc/winutils/include/SDL_stdinc.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_stdinc.h Tue Jan 21 22:43:06 2014 +0100
@@ -75,8 +75,8 @@
#endif
/** The number of elements in an array */
-#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
-#define SDL_TABLESIZE(table) SDL_arraysize(table)
+#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
+#define SDL_TABLESIZE(table) SDL_arraysize(table)
/* Use proper C++ casts when compiled as C++ to be compatible with the option
-Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
@@ -91,27 +91,27 @@
/** @name Basic data types */
/*@{*/
typedef enum {
- SDL_FALSE = 0,
- SDL_TRUE = 1
+ SDL_FALSE = 0,
+ SDL_TRUE = 1
} SDL_bool;
-typedef int8_t Sint8;
-typedef uint8_t Uint8;
-typedef int16_t Sint16;
-typedef uint16_t Uint16;
-typedef int32_t Sint32;
-typedef uint32_t Uint32;
+typedef int8_t Sint8;
+typedef uint8_t Uint8;
+typedef int16_t Sint16;
+typedef uint16_t Uint16;
+typedef int32_t Sint32;
+typedef uint32_t Uint32;
#ifdef SDL_HAS_64BIT_TYPE
-typedef int64_t Sint64;
+typedef int64_t Sint64;
#ifndef SYMBIAN32_GCCE
-typedef uint64_t Uint64;
+typedef uint64_t Uint64;
#endif
#else
/* This is really just a hack to prevent the compiler from complaining */
typedef struct {
- Uint32 hi;
- Uint32 lo;
+ Uint32 hi;
+ Uint32 lo;
} Uint64, Sint64;
#endif
@@ -144,7 +144,7 @@
#endif
typedef enum {
- DUMMY_ENUM_VALUE
+ DUMMY_ENUM_VALUE
} SDL_DUMMY_ENUM;
#ifndef __NDS__
@@ -159,25 +159,25 @@
#endif
#ifdef HAVE_MALLOC
-#define SDL_malloc malloc
+#define SDL_malloc malloc
#else
extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
#endif
#ifdef HAVE_CALLOC
-#define SDL_calloc calloc
+#define SDL_calloc calloc
#else
extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
#endif
#ifdef HAVE_REALLOC
-#define SDL_realloc realloc
+#define SDL_realloc realloc
#else
extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
#endif
#ifdef HAVE_FREE
-#define SDL_free free
+#define SDL_free free
#else
extern DECLSPEC void SDLCALL SDL_free(void *mem);
#endif
@@ -213,32 +213,32 @@
#endif
#ifdef HAVE_GETENV
-#define SDL_getenv getenv
+#define SDL_getenv getenv
#else
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
#endif
#ifdef HAVE_PUTENV
-#define SDL_putenv putenv
+#define SDL_putenv putenv
#else
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
#endif
#ifdef HAVE_QSORT
-#define SDL_qsort qsort
+#define SDL_qsort qsort
#else
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
int (*compare)(const void *, const void *));
#endif
#ifdef HAVE_ABS
-#define SDL_abs abs
+#define SDL_abs abs
#else
-#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
+#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
#endif
-#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
-#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
+#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
+#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
#ifdef HAVE_CTYPE_H
#define SDL_isdigit(X) isdigit(X)
@@ -259,32 +259,32 @@
#endif
#if defined(__GNUC__) && defined(i386)
-#define SDL_memset4(dst, val, len) \
-do { \
- int u0, u1, u2; \
- __asm__ __volatile__ ( \
- "cld\n\t" \
- "rep ; stosl\n\t" \
- : "=&D" (u0), "=&a" (u1), "=&c" (u2) \
- : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \
- : "memory" ); \
+#define SDL_memset4(dst, val, len) \
+do { \
+ int u0, u1, u2; \
+ __asm__ __volatile__ ( \
+ "cld\n\t" \
+ "rep ; stosl\n\t" \
+ : "=&D" (u0), "=&a" (u1), "=&c" (u2) \
+ : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \
+ : "memory" ); \
} while(0)
#endif
#ifndef SDL_memset4
-#define SDL_memset4(dst, val, len) \
-do { \
- unsigned _count = (len); \
- unsigned _n = (_count + 3) / 4; \
- Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
- Uint32 _val = (val); \
- if (len == 0) break; \
- switch (_count % 4) { \
- case 0: do { *_p++ = _val; \
- case 3: *_p++ = _val; \
- case 2: *_p++ = _val; \
- case 1: *_p++ = _val; \
- } while ( --_n ); \
- } \
+#define SDL_memset4(dst, val, len) \
+do { \
+ unsigned _count = (len); \
+ unsigned _n = (_count + 3) / 4; \
+ Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
+ Uint32 _val = (val); \
+ if (len == 0) break; \
+ switch (_count % 4) { \
+ case 0: do { *_p++ = _val; \
+ case 3: *_p++ = _val; \
+ case 2: *_p++ = _val; \
+ case 1: *_p++ = _val; \
+ } while ( --_n ); \
+ } \
} while(0)
#endif
@@ -292,29 +292,29 @@
#if defined(__MACH__) && defined(__APPLE__)
#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
#elif defined(__GNUC__) && defined(i386)
-#define SDL_memcpy(dst, src, len) \
-do { \
- int u0, u1, u2; \
- __asm__ __volatile__ ( \
- "cld\n\t" \
- "rep ; movsl\n\t" \
- "testb $2,%b4\n\t" \
- "je 1f\n\t" \
- "movsw\n" \
- "1:\ttestb $1,%b4\n\t" \
- "je 2f\n\t" \
- "movsb\n" \
- "2:" \
- : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
- : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
- : "memory" ); \
+#define SDL_memcpy(dst, src, len) \
+do { \
+ int u0, u1, u2; \
+ __asm__ __volatile__ ( \
+ "cld\n\t" \
+ "rep ; movsl\n\t" \
+ "testb $2,%b4\n\t" \
+ "je 1f\n\t" \
+ "movsw\n" \
+ "1:\ttestb $1,%b4\n\t" \
+ "je 2f\n\t" \
+ "movsb\n" \
+ "2:" \
+ : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
+ : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
+ : "memory" ); \
} while(0)
#endif
#ifndef SDL_memcpy
#ifdef HAVE_MEMCPY
#define SDL_memcpy memcpy
#elif defined(HAVE_BCOPY)
-#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
+#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
#else
extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
#endif
@@ -324,46 +324,46 @@
#if defined(__MACH__) && defined(__APPLE__)
#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
#elif defined(__GNUC__) && defined(i386)
-#define SDL_memcpy4(dst, src, len) \
-do { \
- int ecx, edi, esi; \
- __asm__ __volatile__ ( \
- "cld\n\t" \
- "rep ; movsl" \
- : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
- : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \
- : "memory" ); \
+#define SDL_memcpy4(dst, src, len) \
+do { \
+ int ecx, edi, esi; \
+ __asm__ __volatile__ ( \
+ "cld\n\t" \
+ "rep ; movsl" \
+ : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
+ : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \
+ : "memory" ); \
} while(0)
#endif
#ifndef SDL_memcpy4
-#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
+#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
#endif
#if defined(__GNUC__) && defined(i386)
-#define SDL_revcpy(dst, src, len) \
-do { \
- int u0, u1, u2; \
- char *dstp = SDL_static_cast(char *, dst); \
- char *srcp = SDL_static_cast(char *, src); \
- int n = (len); \
- if ( n >= 4 ) { \
- __asm__ __volatile__ ( \
- "std\n\t" \
- "rep ; movsl\n\t" \
- "cld\n\t" \
- : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
- : "0" (n >> 2), \
- "1" (dstp+(n-4)), "2" (srcp+(n-4)) \
- : "memory" ); \
- } \
- switch (n & 3) { \
- case 3: dstp[2] = srcp[2]; \
- case 2: dstp[1] = srcp[1]; \
- case 1: dstp[0] = srcp[0]; \
- break; \
- default: \
- break; \
- } \
+#define SDL_revcpy(dst, src, len) \
+do { \
+ int u0, u1, u2; \
+ char *dstp = SDL_static_cast(char *, dst); \
+ char *srcp = SDL_static_cast(char *, src); \
+ int n = (len); \
+ if ( n >= 4 ) { \
+ __asm__ __volatile__ ( \
+ "std\n\t" \
+ "rep ; movsl\n\t" \
+ "cld\n\t" \
+ : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
+ : "0" (n >> 2), \
+ "1" (dstp+(n-4)), "2" (srcp+(n-4)) \
+ : "memory" ); \
+ } \
+ switch (n & 3) { \
+ case 3: dstp[2] = srcp[2]; \
+ case 2: dstp[1] = srcp[1]; \
+ case 1: dstp[0] = srcp[0]; \
+ break; \
+ default: \
+ break; \
+ } \
} while(0)
#endif
#ifndef SDL_revcpy
@@ -373,15 +373,15 @@
#ifdef HAVE_MEMMOVE
#define SDL_memmove memmove
#elif defined(HAVE_BCOPY)
-#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
+#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
#else
-#define SDL_memmove(dst, src, len) \
-do { \
- if ( dst < src ) { \
- SDL_memcpy(dst, src, len); \
- } else { \
- SDL_revcpy(dst, src, len); \
- } \
+#define SDL_memmove(dst, src, len) \
+do { \
+ if ( dst < src ) { \
+ SDL_memcpy(dst, src, len); \
+ } else { \
+ SDL_revcpy(dst, src, len); \
+ } \
} while(0)
#endif
@@ -458,7 +458,7 @@
#ifdef HAVE_ITOA
#define SDL_itoa itoa
#else
-#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
+#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
#endif
#ifdef HAVE__LTOA
@@ -470,7 +470,7 @@
#ifdef HAVE__UITOA
#define SDL_uitoa _uitoa
#else
-#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
+#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
#endif
#ifdef HAVE__ULTOA
@@ -584,13 +584,13 @@
#endif
/** @name SDL_ICONV Error Codes
- * The SDL implementation of iconv() returns these error codes
+ * The SDL implementation of iconv() returns these error codes
*/
/*@{*/
-#define SDL_ICONV_ERROR (size_t)-1
-#define SDL_ICONV_E2BIG (size_t)-2
-#define SDL_ICONV_EILSEQ (size_t)-3
-#define SDL_ICONV_EINVAL (size_t)-4
+#define SDL_ICONV_ERROR (size_t)-1
+#define SDL_ICONV_E2BIG (size_t)-2
+#define SDL_ICONV_EILSEQ (size_t)-3
+#define SDL_ICONV_EINVAL (size_t)-4
/*@}*/
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
@@ -607,9 +607,9 @@
* string that must be freed with SDL_free() or NULL on error.
*/
extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
-#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_syswm.h
--- a/misc/winutils/include/SDL_syswm.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_syswm.h Tue Jan 21 22:43:06 2014 +0100
@@ -65,16 +65,16 @@
/** These are the various supported subsystems under UNIX */
typedef enum {
- SDL_SYSWM_X11
+ SDL_SYSWM_X11
} SDL_SYSWM_TYPE;
/** The UNIX custom event structure */
struct SDL_SysWMmsg {
- SDL_version version;
- SDL_SYSWM_TYPE subsystem;
- union {
- XEvent xevent;
- } event;
+ SDL_version version;
+ SDL_SYSWM_TYPE subsystem;
+ union {
+ XEvent xevent;
+ } event;
};
/** The UNIX custom window manager information structure.
@@ -82,35 +82,35 @@
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
typedef struct SDL_SysWMinfo {
- SDL_version version;
- SDL_SYSWM_TYPE subsystem;
- union {
- struct {
- Display *display; /**< The X11 display */
- Window window; /**< The X11 display window */
- /** These locking functions should be called around
- * any X11 functions using the display variable,
+ SDL_version version;
+ SDL_SYSWM_TYPE subsystem;
+ union {
+ struct {
+ Display *display; /**< The X11 display */
+ Window window; /**< The X11 display window */
+ /** These locking functions should be called around
+ * any X11 functions using the display variable,
* but not the gfxdisplay variable.
* They lock the event thread, so should not be
- * called around event functions or from event filters.
- */
+ * called around event functions or from event filters.
+ */
/*@{*/
- void (*lock_func)(void);
- void (*unlock_func)(void);
+ void (*lock_func)(void);
+ void (*unlock_func)(void);
/*@}*/
- /** @name Introduced in SDL 1.0.2 */
+ /** @name Introduced in SDL 1.0.2 */
/*@{*/
- Window fswindow; /**< The X11 fullscreen window */
- Window wmwindow; /**< The X11 managed input window */
+ Window fswindow; /**< The X11 fullscreen window */
+ Window wmwindow; /**< The X11 managed input window */
/*@}*/
- /** @name Introduced in SDL 1.2.12 */
+ /** @name Introduced in SDL 1.2.12 */
/*@{*/
- Display *gfxdisplay; /**< The X11 display to which rendering is done */
+ Display *gfxdisplay; /**< The X11 display to which rendering is done */
/*@}*/
- } x11;
- } info;
+ } x11;
+ } info;
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_NANOX)
@@ -118,14 +118,14 @@
/** The generic custom event structure */
struct SDL_SysWMmsg {
- SDL_version version;
- int data;
+ SDL_version version;
+ int data;
};
/** The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
- SDL_version version ;
- GR_WINDOW_ID window ; /* The display window */
+ SDL_version version ;
+ GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
@@ -134,35 +134,35 @@
/** The windows custom event structure */
struct SDL_SysWMmsg {
- SDL_version version;
- HWND hwnd; /**< The window for the message */
- UINT msg; /**< The type of message */
- WPARAM wParam; /**< WORD message parameter */
- LPARAM lParam; /**< LONG message parameter */
+ SDL_version version;
+ HWND hwnd; /**< The window for the message */
+ UINT msg; /**< The type of message */
+ WPARAM wParam; /**< WORD message parameter */
+ LPARAM lParam; /**< LONG message parameter */
};
/** The windows custom window manager information structure */
typedef struct SDL_SysWMinfo {
- SDL_version version;
- HWND window; /**< The Win32 display window */
- HGLRC hglrc; /**< The OpenGL context, if any */
+ SDL_version version;
+ HWND window; /**< The Win32 display window */
+ HGLRC hglrc; /**< The OpenGL context, if any */
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
/** RISC OS custom event structure */
struct SDL_SysWMmsg {
- SDL_version version;
- int eventCode; /**< The window for the message */
- int pollBlock[64];
+ SDL_version version;
+ int eventCode; /**< The window for the message */
+ int pollBlock[64];
};
/** The RISC OS custom window manager information structure */
typedef struct SDL_SysWMinfo {
- SDL_version version;
- int wimpVersion; /**< Wimp version running under */
- int taskHandle; /**< The RISC OS task handle */
- int window; /**< The RISC OS display window */
+ SDL_version version;
+ int wimpVersion; /**< Wimp version running under */
+ int taskHandle; /**< The RISC OS task handle */
+ int window; /**< The RISC OS display window */
} SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
@@ -171,28 +171,28 @@
/** The QNX custom event structure */
struct SDL_SysWMmsg {
- SDL_version version;
- int data;
+ SDL_version version;
+ int data;
};
/** The QNX custom window manager information structure */
typedef struct SDL_SysWMinfo {
- SDL_version version;
- int data;
+ SDL_version version;
+ int data;
} SDL_SysWMinfo;
#else
/** The generic custom event structure */
struct SDL_SysWMmsg {
- SDL_version version;
- int data;
+ SDL_version version;
+ int data;
};
/** The generic custom window manager information structure */
typedef struct SDL_SysWMinfo {
- SDL_version version;
- int data;
+ SDL_version version;
+ int data;
} SDL_SysWMinfo;
#endif /* video driver type */
@@ -203,7 +203,7 @@
/**
* This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and
- * returns 0 if the function is not implemented, 1 if the function is
+ * returns 0 if the function is not implemented, 1 if the function is
* implemented and no error occurred, and -1 if the version member of
* the 'info' structure is not filled in or not supported.
*
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_thread.h
--- a/misc/winutils/include/SDL_thread.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_thread.h Tue Jan 21 22:43:06 2014 +0100
@@ -24,7 +24,7 @@
#define _SDL_thread_h
/** @file SDL_thread.h
- * Header for the SDL thread management routines
+ * Header for the SDL thread management routines
*
* @note These are independent of the other SDL routines.
*/
@@ -66,11 +66,11 @@
#endif
#ifdef __OS2__
-typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
+typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
typedef void (*pfnSDL_CurrentEndThread)(void);
#else
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
- unsigned (__stdcall *func)(void *), void *arg,
+ unsigned (__stdcall *func)(void *), void *arg,
unsigned, unsigned *threadID);
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
#endif
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_timer.h
--- a/misc/winutils/include/SDL_timer.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_timer.h Tue Jan 21 22:43:06 2014 +0100
@@ -37,15 +37,15 @@
#endif
/** This is the OS scheduler timeslice, in milliseconds */
-#define SDL_TIMESLICE 10
+#define SDL_TIMESLICE 10
/** This is the maximum resolution of the SDL timer on all platforms */
-#define TIMER_RESOLUTION 10 /**< Experimentally determined */
+#define TIMER_RESOLUTION 10 /**< Experimentally determined */
/**
* Get the number of milliseconds since the SDL library initialization.
* Note that this value wraps if the program runs for more than ~49 days.
- */
+ */
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
/** Wait a specified number of milliseconds before returning */
@@ -57,7 +57,7 @@
/**
* Set a callback to run after the specified number of milliseconds has
* elapsed. The callback function is passed the current timer interval
- * and returns the next timer interval. If the returned value is the
+ * and returns the next timer interval. If the returned value is the
* same as the one passed in, the periodic alarm continues, otherwise a
* new alarm is scheduled. If the callback returns 0, the periodic alarm
* is cancelled.
@@ -70,7 +70,7 @@
* The maximum resolution of this timer is 10 ms, which means that if
* you request a 16 ms timer, your callback will run approximately 20 ms
* later on an unloaded system. If you wanted to set a flag signaling
- * a frame update at 30 frames per second (every 33 ms), you might set a
+ * a frame update at 30 frames per second (every 33 ms), you might set a
* timer for 30 ms:
* @code SDL_SetTimer((33/10)*10, flag_update); @endcode
*
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_version.h
--- a/misc/winutils/include/SDL_version.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_version.h Tue Jan 21 22:43:06 2014 +0100
@@ -39,42 +39,42 @@
* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
/*@{*/
-#define SDL_MAJOR_VERSION 1
-#define SDL_MINOR_VERSION 2
-#define SDL_PATCHLEVEL 15
+#define SDL_MAJOR_VERSION 1
+#define SDL_MINOR_VERSION 2
+#define SDL_PATCHLEVEL 15
/*@}*/
typedef struct SDL_version {
- Uint8 major;
- Uint8 minor;
- Uint8 patch;
+ Uint8 major;
+ Uint8 minor;
+ Uint8 patch;
} SDL_version;
/**
* This macro can be used to fill a version structure with the compile-time
* version of the SDL library.
*/
-#define SDL_VERSION(X) \
-{ \
- (X)->major = SDL_MAJOR_VERSION; \
- (X)->minor = SDL_MINOR_VERSION; \
- (X)->patch = SDL_PATCHLEVEL; \
+#define SDL_VERSION(X) \
+{ \
+ (X)->major = SDL_MAJOR_VERSION; \
+ (X)->minor = SDL_MINOR_VERSION; \
+ (X)->patch = SDL_PATCHLEVEL; \
}
/** This macro turns the version numbers into a numeric value:
* (1,2,3) -> (1203)
* This assumes that there will never be more than 100 patchlevels
*/
-#define SDL_VERSIONNUM(X, Y, Z) \
- ((X)*1000 + (Y)*100 + (Z))
+#define SDL_VERSIONNUM(X, Y, Z) \
+ ((X)*1000 + (Y)*100 + (Z))
/** This is the version number macro for the current SDL version */
#define SDL_COMPILEDVERSION \
- SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
+ SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */
#define SDL_VERSION_ATLEAST(X, Y, Z) \
- (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
+ (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
/** This function gets the version of the dynamically linked SDL library.
* it should NOT be used to fill a version structure, instead you should
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/SDL_video.h
--- a/misc/winutils/include/SDL_video.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/SDL_video.h Tue Jan 21 22:43:06 2014 +0100
@@ -48,77 +48,77 @@
/** @name Useful data types */
/*@{*/
typedef struct SDL_Rect {
- Sint16 x, y;
- Uint16 w, h;
+ Sint16 x, y;
+ Uint16 w, h;
} SDL_Rect;
typedef struct SDL_Color {
- Uint8 r;
- Uint8 g;
- Uint8 b;
- Uint8 unused;
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 unused;
} SDL_Color;
#define SDL_Colour SDL_Color
typedef struct SDL_Palette {
- int ncolors;
- SDL_Color *colors;
+ int ncolors;
+ SDL_Color *colors;
} SDL_Palette;
/*@}*/
/** Everything in the pixel format structure is read-only */
typedef struct SDL_PixelFormat {
- SDL_Palette *palette;
- Uint8 BitsPerPixel;
- Uint8 BytesPerPixel;
- Uint8 Rloss;
- Uint8 Gloss;
- Uint8 Bloss;
- Uint8 Aloss;
- Uint8 Rshift;
- Uint8 Gshift;
- Uint8 Bshift;
- Uint8 Ashift;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- Uint32 Amask;
+ SDL_Palette *palette;
+ Uint8 BitsPerPixel;
+ Uint8 BytesPerPixel;
+ Uint8 Rloss;
+ Uint8 Gloss;
+ Uint8 Bloss;
+ Uint8 Aloss;
+ Uint8 Rshift;
+ Uint8 Gshift;
+ Uint8 Bshift;
+ Uint8 Ashift;
+ Uint32 Rmask;
+ Uint32 Gmask;
+ Uint32 Bmask;
+ Uint32 Amask;
- /** RGB color key information */
- Uint32 colorkey;
- /** Alpha value information (per-surface alpha) */
- Uint8 alpha;
+ /** RGB color key information */
+ Uint32 colorkey;
+ /** Alpha value information (per-surface alpha) */
+ Uint8 alpha;
} SDL_PixelFormat;
/** This structure should be treated as read-only, except for 'pixels',
* which, if not NULL, contains the raw pixel data for the surface.
*/
typedef struct SDL_Surface {
- Uint32 flags; /**< Read-only */
- SDL_PixelFormat *format; /**< Read-only */
- int w, h; /**< Read-only */
- Uint16 pitch; /**< Read-only */
- void *pixels; /**< Read-write */
- int offset; /**< Private */
+ Uint32 flags; /**< Read-only */
+ SDL_PixelFormat *format; /**< Read-only */
+ int w, h; /**< Read-only */
+ Uint16 pitch; /**< Read-only */
+ void *pixels; /**< Read-write */
+ int offset; /**< Private */
- /** Hardware-specific surface info */
- struct private_hwdata *hwdata;
+ /** Hardware-specific surface info */
+ struct private_hwdata *hwdata;
- /** clipping information */
- SDL_Rect clip_rect; /**< Read-only */
- Uint32 unused1; /**< for binary compatibility */
+ /** clipping information */
+ SDL_Rect clip_rect; /**< Read-only */
+ Uint32 unused1; /**< for binary compatibility */
- /** Allow recursive locks */
- Uint32 locked; /**< Private */
+ /** Allow recursive locks */
+ Uint32 locked; /**< Private */
- /** info for fast blit mapping to other surfaces */
- struct SDL_BlitMap *map; /**< Private */
+ /** info for fast blit mapping to other surfaces */
+ struct SDL_BlitMap *map; /**< Private */
- /** format version, bumped at every change to invalidate blit maps */
- unsigned int format_version; /**< Private */
+ /** format version, bumped at every change to invalidate blit maps */
+ unsigned int format_version; /**< Private */
- /** Reference count -- used when freeing surface */
- int refcount; /**< Read-mostly */
+ /** Reference count -- used when freeing surface */
+ int refcount; /**< Read-mostly */
} SDL_Surface;
/** @name SDL_Surface Flags
@@ -128,100 +128,100 @@
/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
/*@{*/
-#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */
-#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */
-#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */
+#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */
+#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */
+#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */
/*@}*/
/** Available for SDL_SetVideoMode() */
/*@{*/
-#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */
-#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */
-#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */
-#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */
+#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */
+#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */
+#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */
+#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */
#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */
-#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */
-#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */
-#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */
+#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */
+#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */
+#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */
/*@}*/
/** Used internally (read-only) */
/*@{*/
-#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */
-#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */
-#define SDL_RLEACCELOK 0x00002000 /**< Private flag */
-#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */
-#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */
-#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */
+#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */
+#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */
+#define SDL_RLEACCELOK 0x00002000 /**< Private flag */
+#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */
+#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */
+#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */
/*@}*/
/*@}*/
/** Evaluates to true if the surface needs to be locked before access */
-#define SDL_MUSTLOCK(surface) \
- (surface->offset || \
+#define SDL_MUSTLOCK(surface) \
+ (surface->offset || \
((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
/** typedef for private surface blitting functions */
typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
- struct SDL_Surface *dst, SDL_Rect *dstrect);
+ struct SDL_Surface *dst, SDL_Rect *dstrect);
/** Useful for determining the video hardware capabilities */
typedef struct SDL_VideoInfo {
- Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */
- Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */
- Uint32 UnusedBits1 :6;
- Uint32 UnusedBits2 :1;
- Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */
- Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */
- Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */
- Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */
- Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */
- Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */
- Uint32 blit_fill :1; /**< Flag: Accelerated color fill */
- Uint32 UnusedBits3 :16;
- Uint32 video_mem; /**< The total amount of video memory (in K) */
- SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */
- int current_w; /**< Value: The current video mode width */
- int current_h; /**< Value: The current video mode height */
+ Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */
+ Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */
+ Uint32 UnusedBits1 :6;
+ Uint32 UnusedBits2 :1;
+ Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */
+ Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */
+ Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */
+ Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */
+ Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */
+ Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */
+ Uint32 blit_fill :1; /**< Flag: Accelerated color fill */
+ Uint32 UnusedBits3 :16;
+ Uint32 video_mem; /**< The total amount of video memory (in K) */
+ SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */
+ int current_w; /**< Value: The current video mode width */
+ int current_h; /**< Value: The current video mode height */
} SDL_VideoInfo;
/** @name Overlay Formats
* The most common video overlay formats.
* For an explanation of these pixel formats, see:
- * http://www.webartz.com/fourcc/indexyuv.htm
+ * http://www.webartz.com/fourcc/indexyuv.htm
*
* For information on the relationship between color spaces, see:
* http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
/*@{*/
-#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */
-#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */
-#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
-#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
-#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
+#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */
+#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */
+#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
+#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
+#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
/*@}*/
/** The YUV hardware video overlay */
typedef struct SDL_Overlay {
- Uint32 format; /**< Read-only */
- int w, h; /**< Read-only */
- int planes; /**< Read-only */
- Uint16 *pitches; /**< Read-only */
- Uint8 **pixels; /**< Read-write */
+ Uint32 format; /**< Read-only */
+ int w, h; /**< Read-only */
+ int planes; /**< Read-only */
+ Uint16 *pitches; /**< Read-only */
+ Uint8 **pixels; /**< Read-write */
- /** @name Hardware-specific surface info */
+ /** @name Hardware-specific surface info */
/*@{*/
- struct private_yuvhwfuncs *hwfuncs;
- struct private_yuvhwdata *hwdata;
+ struct private_yuvhwfuncs *hwfuncs;
+ struct private_yuvhwdata *hwdata;
/*@{*/
- /** @name Special flags */
+ /** @name Special flags */
/*@{*/
- Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */
- Uint32 UnusedBits :31;
+ Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */
+ Uint32 UnusedBits :31;
/*@}*/
} SDL_Overlay;
@@ -314,11 +314,11 @@
/**
* Return a pointer to an array of available screen dimensions for the
- * given format and video flags, sorted largest to smallest. Returns
- * NULL if there are no dimensions available for a particular format,
+ * given format and video flags, sorted largest to smallest. Returns
+ * NULL if there are no dimensions available for a particular format,
* or (SDL_Rect **)-1 if any dimension is okay for the given format.
*
- * If 'format' is NULL, the mode list will be for the format given
+ * If 'format' is NULL, the mode list will be for the format given
* by SDL_GetVideoInfo()->vfmt
*/
extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
@@ -347,21 +347,21 @@
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
* of the colors exactly the way they are requested, and you should look
* at the video surface structure to determine the actual palette.
- * If SDL cannot guarantee that the colors you request can be set,
+ * If SDL cannot guarantee that the colors you request can be set,
* i.e. if the colormap is shared, then the video surface may be created
* under emulation in system memory, overriding the SDL_HWSURFACE flag.
*
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
* a fullscreen video mode. The default is to create a windowed mode
* if the current graphics system has a window manager.
- * If the SDL library is able to set a fullscreen video mode, this flag
+ * If the SDL library is able to set a fullscreen video mode, this flag
* will be set in the surface that is returned.
*
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
- * two surfaces in video memory and swap between them when you call
+ * two surfaces in video memory and swap between them when you call
* SDL_Flip(). This is usually slower than the normal single-buffering
- * scheme, but prevents "tearing" artifacts caused by modifying video
- * memory while the monitor is refreshing. It should only be used by
+ * scheme, but prevents "tearing" artifacts caused by modifying video
+ * memory while the monitor is refreshing. It should only be used by
* applications that redraw the entire screen on every update.
*
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
@@ -382,7 +382,7 @@
* are not available.
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
- (int width, int height, int bpp, Uint32 flags);
+ (int width, int height, int bpp, Uint32 flags);
/** @name SDL_Update Functions
* These functions should not be called while 'screen' is locked.
@@ -392,13 +392,13 @@
* Makes sure the given list of rectangles is updated on the given screen.
*/
extern DECLSPEC void SDLCALL SDL_UpdateRects
- (SDL_Surface *screen, int numrects, SDL_Rect *rects);
+ (SDL_Surface *screen, int numrects, SDL_Rect *rects);
/**
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
* screen.
*/
extern DECLSPEC void SDLCALL SDL_UpdateRect
- (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
+ (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
/*@}*/
/**
@@ -416,7 +416,7 @@
/**
* Set the gamma correction for each of the color channels.
* The gamma values range (approximately) between 0.1 and 10.0
- *
+ *
* If this function isn't supported directly by the hardware, it will
* be emulated using gamma ramps, if available. If successful, this
* function returns 0, otherwise it returns -1.
@@ -429,7 +429,7 @@
* representing a mapping between the input and output for that channel.
* The input is the index into the array, and the output is the 16-bit
* gamma value at that index, scaled to the output color precision.
- *
+ *
* You may pass NULL for any of the channels to leave it unchanged.
* If the call succeeds, it will return 0. If the display driver or
* hardware does not support gamma translation, or otherwise fails,
@@ -439,7 +439,7 @@
/**
* Retrieve the current values of the gamma translation tables.
- *
+ *
* You must pass in valid pointers to arrays of 256 16-bit quantities.
* Any of the pointers may be NULL to ignore that channel.
* If the call succeeds, it will return 0. If the display driver or
@@ -457,14 +457,14 @@
* determine the actual color palette.
*
* When 'surface' is the surface associated with the current display, the
- * display colormap will be updated with the requested colors. If
+ * display colormap will be updated with the requested colors. If
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
* will always return 1, and the palette is guaranteed to be set the way
* you desire, even if the window colormap has to be warped or run under
* emulation.
*/
-extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
- SDL_Color *colors, int firstcolor, int ncolors);
+extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
+ SDL_Color *colors, int firstcolor, int ncolors);
/**
* Sets a portion of the colormap for a given 8-bit surface.
@@ -483,8 +483,8 @@
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
*/
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
- SDL_Color *colors, int firstcolor,
- int ncolors);
+ SDL_Color *colors, int firstcolor,
+ int ncolors);
/**
* Maps an RGB triple to an opaque pixel value for a given pixel format
@@ -504,15 +504,15 @@
* Maps a pixel value into the RGB components for a given pixel format
*/
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
- const SDL_PixelFormat * const fmt,
- Uint8 *r, Uint8 *g, Uint8 *b);
+ const SDL_PixelFormat * const fmt,
+ Uint8 *r, Uint8 *g, Uint8 *b);
/**
* Maps a pixel value into the RGBA components for a given pixel format
*/
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
- const SDL_PixelFormat * const fmt,
- Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
+ const SDL_PixelFormat * const fmt,
+ Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
/** @sa SDL_CreateRGBSurface */
#define SDL_AllocSurface SDL_CreateRGBSurface
@@ -537,7 +537,7 @@
* two surfaces in video memory, SDL will try to place the surface in
* video memory. If this isn't possible or if there is no hardware
* acceleration available, the surface will be placed in system memory.
- * SDL_SRCALPHA means that the surface will be used for alpha blits and
+ * SDL_SRCALPHA means that the surface will be used for alpha blits and
* if the hardware supports hardware acceleration of alpha blits between
* two surfaces in video memory, to place the surface in video memory
* if possible, otherwise it will be placed in system memory.
@@ -551,19 +551,19 @@
* the SDL_HWSURFACE flag set, and will be created in system memory instead.
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
- (Uint32 flags, int width, int height, int depth,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+ (Uint32 flags, int width, int height, int depth,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
/** @sa SDL_CreateRGBSurface */
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
- int width, int height, int depth, int pitch,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+ int width, int height, int depth, int pitch,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
/**
* SDL_LockSurface() sets up a surface for directly accessing the pixels.
* Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
- * to and read from 'surface->pixels', using the pixel format stored in
- * 'surface->format'. Once you are done accessing the surface, you should
+ * to and read from 'surface->pixels', using the pixel format stored in
+ * 'surface->format'. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
@@ -571,7 +571,7 @@
* pixel format of the surface will not change. In particular, if the
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
* will not need to lock the display surface before accessing it.
- *
+ *
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
@@ -589,7 +589,7 @@
extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
/** Convenience macro -- load a surface from a file */
-#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
+#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
/**
* Save a surface to a seekable SDL data source (memory or file.)
@@ -597,15 +597,15 @@
* Returns 0 if successful or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
- (SDL_Surface *surface, SDL_RWops *dst, int freedst);
+ (SDL_Surface *surface, SDL_RWops *dst, int freedst);
/** Convenience macro -- save a surface to a file */
#define SDL_SaveBMP(surface, file) \
- SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
+ SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
/**
* Sets the color key (transparent pixel) in a blittable surface.
- * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
+ * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
* 'key' will be the transparent pixel in the source image of a blit.
* SDL_RLEACCEL requests RLE acceleration for the surface if present,
* and removes RLE acceleration if absent.
@@ -613,7 +613,7 @@
* This function returns 0, or -1 if there was an error.
*/
extern DECLSPEC int SDLCALL SDL_SetColorKey
- (SDL_Surface *surface, Uint32 flag, Uint32 key);
+ (SDL_Surface *surface, Uint32 flag, Uint32 key);
/**
* This function sets the alpha value for the entire surface, as opposed to
@@ -654,11 +654,11 @@
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
/**
- * Creates a new surface of the specified format, and then copies and maps
- * the given surface to it so the blit of the converted surface will be as
+ * Creates a new surface of the specified format, and then copies and maps
+ * the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
- * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
+ * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
@@ -666,7 +666,7 @@
* This function is used internally by SDL_DisplayFormat().
*/
extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
- (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
+ (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
/**
* This performs a fast blit from the source surface to the destination
@@ -683,54 +683,54 @@
*
* RGBA->RGB:
* SDL_SRCALPHA set:
- * alpha-blend (using alpha-channel).
- * SDL_SRCCOLORKEY ignored.
+ * alpha-blend (using alpha-channel).
+ * SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
- * copy RGB.
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * RGB values of the source colour key, ignoring alpha in the
- * comparison.
- *
+ * copy RGB.
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * RGB values of the source colour key, ignoring alpha in the
+ * comparison.
+ *
* RGB->RGBA:
* SDL_SRCALPHA set:
- * alpha-blend (using the source per-surface alpha value);
- * set destination alpha to opaque.
+ * alpha-blend (using the source per-surface alpha value);
+ * set destination alpha to opaque.
* SDL_SRCALPHA not set:
- * copy RGB, set destination alpha to source per-surface alpha value.
+ * copy RGB, set destination alpha to source per-surface alpha value.
* both:
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * source colour key.
- *
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * source colour key.
+ *
* RGBA->RGBA:
* SDL_SRCALPHA set:
- * alpha-blend (using the source alpha channel) the RGB values;
- * leave destination alpha untouched. [Note: is this correct?]
- * SDL_SRCCOLORKEY ignored.
+ * alpha-blend (using the source alpha channel) the RGB values;
+ * leave destination alpha untouched. [Note: is this correct?]
+ * SDL_SRCCOLORKEY ignored.
* SDL_SRCALPHA not set:
- * copy all of RGBA to the destination.
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * RGB values of the source colour key, ignoring alpha in the
- * comparison.
- *
- * RGB->RGB:
+ * copy all of RGBA to the destination.
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * RGB values of the source colour key, ignoring alpha in the
+ * comparison.
+ *
+ * RGB->RGB:
* SDL_SRCALPHA set:
- * alpha-blend (using the source per-surface alpha value).
+ * alpha-blend (using the source per-surface alpha value).
* SDL_SRCALPHA not set:
- * copy RGB.
+ * copy RGB.
* both:
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * source colour key.
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * source colour key.
*
* If either of the surfaces were in video memory, and the blit returns -2,
- * the video memory was lost, so it should be reloaded with artwork and
+ * the video memory was lost, so it should be reloaded with artwork and
* re-blitted:
* @code
- * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
- * while ( SDL_LockSurface(image) < 0 )
- * Sleep(10);
- * -- Write image pixels to image->pixels --
- * SDL_UnlockSurface(image);
- * }
+ * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+ * while ( SDL_LockSurface(image) < 0 )
+ * Sleep(10);
+ * -- Write image pixels to image->pixels --
+ * SDL_UnlockSurface(image);
+ * }
* @endcode
*
* This happens under DirectX 5.0 when the system switches away from your
@@ -746,26 +746,26 @@
* rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
extern DECLSPEC int SDLCALL SDL_UpperBlit
- (SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
+ (SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
/** This is a semi-private blit function and it performs low-level surface
* blitting only.
*/
extern DECLSPEC int SDLCALL SDL_LowerBlit
- (SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
+ (SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
/**
* This function performs a fast fill of the given rectangle with 'color'
* The given rectangle is clipped to the destination surface clip area
* and the final fill rectangle is saved in the passed in pointer.
* If 'dstrect' is NULL, the whole surface will be filled with 'color'
- * The color should be a pixel of the format used by the surface, and
+ * The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
* This function returns 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_FillRect
- (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
+ (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
/**
* This function takes a surface and copies it to a new surface of the
@@ -805,7 +805,7 @@
* is shown is undefined - it may be overwritten with the converted YUV data.
*/
extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
- Uint32 format, SDL_Surface *display);
+ Uint32 format, SDL_Surface *display);
/** Lock an overlay for direct access, and unlock it when you are done */
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
@@ -813,7 +813,7 @@
/** Blit a video overlay to the display surface.
* The contents of the video surface underneath the blit destination are
- * not defined.
+ * not defined.
* The width and height of the destination rectangle may be different from
* that of the overlay, but currently only 2x scaling is supported.
*/
@@ -908,7 +908,7 @@
* If the display surface does not require locking before accessing
* the pixel information, then the memory pointers will not change.
*
- * If this function was able to toggle fullscreen mode (change from
+ * If this function was able to toggle fullscreen mode (change from
* running in a window to fullscreen, or vice-versa), it will return 1.
* If it is not implemented, or fails, it returns 0.
*
@@ -921,10 +921,10 @@
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
typedef enum {
- SDL_GRAB_QUERY = -1,
- SDL_GRAB_OFF = 0,
- SDL_GRAB_ON = 1,
- SDL_GRAB_FULLSCREEN /**< Used internally */
+ SDL_GRAB_QUERY = -1,
+ SDL_GRAB_OFF = 0,
+ SDL_GRAB_ON = 1,
+ SDL_GRAB_FULLSCREEN /**< Used internally */
} SDL_GrabMode;
/**
* This function allows you to set and query the input grab state of
@@ -941,7 +941,7 @@
/** @internal Not in public API at the moment - do not use! */
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect);
-
+
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
diff -r 4feced261c68 -r de822cd3df3a misc/winutils/include/begin_code.h
--- a/misc/winutils/include/begin_code.h Tue Jan 21 22:38:13 2014 +0100
+++ b/misc/winutils/include/begin_code.h Tue Jan 21 22:43:06 2014 +0100
@@ -20,14 +20,14 @@
slouken@libsdl.org
*/
-/**
+/**
* @file begin_code.h
* This file sets things up for C dynamic library function definitions,
* static inlined functions, and structures aligned at 4-byte alignment.
* If you don't like ugly C preprocessor code, don't look at this file. :)
*/
-/**
+/**
* @file begin_code.h
* This shouldn't be nested -- included it around code only.
*/
@@ -36,7 +36,7 @@
#endif
#define _begin_code_h
-/**
+/**
* @def DECLSPEC
* Some compilers use a special export keyword
*/
@@ -45,22 +45,22 @@
# if defined(__GNUC__)
# define DECLSPEC
# else
-# define DECLSPEC __declspec(export)
+# define DECLSPEC __declspec(export)
# endif
# elif defined(__WIN32__)
# ifdef __BORLANDC__
# ifdef BUILD_SDL
-# define DECLSPEC
+# define DECLSPEC
# else
-# define DECLSPEC __declspec(dllimport)
+# define DECLSPEC __declspec(dllimport)
# endif
# else
-# define DECLSPEC __declspec(dllexport)
+# define DECLSPEC __declspec(dllexport)
# endif
# elif defined(__OS2__)
# ifdef __WATCOMC__
# ifdef BUILD_SDL
-# define DECLSPEC __declspec(dllexport)
+# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC
# endif
@@ -78,14 +78,14 @@
# endif
# else
# if defined(__GNUC__) && __GNUC__ >= 4
-# define DECLSPEC __attribute__ ((visibility("default")))
+# define DECLSPEC __attribute__ ((visibility("default")))
# else
# define DECLSPEC
# endif
# endif
#endif
-/**
+/**
* @def SDLCALL
* By default SDL uses the C calling convention
*/
@@ -108,8 +108,8 @@
# endif
#endif /* SDLCALL */
-#ifdef __SYMBIAN32__
-#ifndef EKA2
+#ifdef __SYMBIAN32__
+#ifndef EKA2
#undef DECLSPEC
#define DECLSPEC
#elif !defined(__WINS__)
@@ -123,7 +123,7 @@
* Force structure packing at 4 byte alignment.
* This is necessary if the header is included in code which has structure
* packing set to an alternate value, say for loading structures from disk.
- * The packing is reset to the previous value in close_code.h
+ * The packing is reset to the previous value in close_code.h
*/
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
#ifdef _MSC_VER
@@ -157,7 +157,7 @@
defined(__WATCOMC__) || defined(__LCC__) || \
defined(__DECC) || defined(__EABI__)
#ifndef __inline__
-#define __inline__ __inline
+#define __inline__ __inline
#endif
#define SDL_INLINE_OKAY
#else
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/AndroidManifest.xml
--- a/project_files/Android-build/SDL-android-project/AndroidManifest.xml Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/AndroidManifest.xml Tue Jan 21 22:43:06 2014 +0100
@@ -46,7 +46,7 @@
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
-
+
GetStaticMethodID(mActivityClass,
"flipBuffers","()V");
- midAudioInit = mEnv->GetStaticMethodID(mActivityClass,
+ midAudioInit = mEnv->GetStaticMethodID(mActivityClass,
"audioInit", "(IZZI)Ljava/lang/Object;");
midAudioWriteShortBuffer = mEnv->GetStaticMethodID(mActivityClass,
"audioWriteShortBuffer", "([S)V");
@@ -165,7 +165,7 @@
// Quit
extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_nativeQuit(
JNIEnv* env, jclass cls)
-{
+{
// Inject a SDL_QUIT event
SDL_SendQuit();
}
@@ -214,7 +214,7 @@
extern "C" void Android_JNI_SwapWindow()
{
- mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers);
+ mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers);
}
extern "C" void Android_JNI_SetActivityTitle(const char *title)
@@ -257,7 +257,7 @@
int status;
JNIEnv *env;
- static bool isAttached = false;
+ static bool isAttached = false;
status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4);
if(status < 0) {
LOGE("callback_handler: failed to get JNI environment, assuming native thread");
@@ -269,7 +269,7 @@
isAttached = true;
}
-
+
__android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
audioBuffer16Bit = is16Bit;
audioBufferStereo = channelCount > 1;
@@ -293,7 +293,7 @@
if (audioBufferStereo) {
audioBufferFrames /= 2;
}
-
+
if (isAttached) {
mJavaVM->DetachCurrentThread();
}
@@ -323,7 +323,7 @@
{
int status;
JNIEnv *env;
- static bool isAttached = false;
+ static bool isAttached = false;
status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4);
if(status < 0) {
LOGE("callback_handler: failed to get JNI environment, assuming native thread");
@@ -335,7 +335,7 @@
isAttached = true;
}
- env->CallStaticVoidMethod(mActivityClass, midAudioQuit);
+ env->CallStaticVoidMethod(mActivityClass, midAudioQuit);
if (audioBuffer) {
env->DeleteGlobalRef(audioBuffer);
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c
--- a/project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c Tue Jan 21 22:43:06 2014 +0100
@@ -45,7 +45,7 @@
/* Functions to read/write Win32 API file pointers */
/* Will not use it on WinCE because stdio is buffered, it means
- faster, and all stdio functions anyway are embedded in coredll.dll -
+ faster, and all stdio functions anyway are embedded in coredll.dll -
the main wince dll*/
#include "../core/windows/SDL_windows.h"
@@ -54,7 +54,7 @@
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
#endif
-#define READAHEAD_BUFFER_SIZE 1024
+#define READAHEAD_BUFFER_SIZE 1024
static int SDLCALL
windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
@@ -473,12 +473,12 @@
rwops->close = windows_file_close;
#elif HAVE_STDIO_H
- #ifdef __APPLE__
- fp = SDL_OpenFPFromBundleOrFallback(file, mode);
+ #ifdef __APPLE__
+ fp = SDL_OpenFPFromBundleOrFallback(file, mode);
#else
- fp = fopen(file, mode);
- #endif
- if (fp == NULL) {
+ fp = fopen(file, mode);
+ #endif
+ if (fp == NULL) {
SDL_SetError("Couldn't open %s", file);
} else {
rwops = SDL_RWFromFP(fp, 1);
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp
--- a/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Tue Jan 21 22:43:06 2014 +0100
@@ -27,19 +27,19 @@
char *argv[argc];
jstring jstringArgv[argc];
for(int i = 0; i < argc; i++){
- jstringArgv[i] = (jstring)env->GetObjectArrayElement(strArray, i); //get the element
- argv[i] = (char*)malloc(env->GetStringUTFLength(jstringArgv[i]) + 1);
- const char *str = env->GetStringUTFChars(jstringArgv[i], NULL);
- strcpy(argv[i], str); //copy it to a mutable location
- env->ReleaseStringUTFChars(jstringArgv[i], str);
+ jstringArgv[i] = (jstring)env->GetObjectArrayElement(strArray, i); //get the element
+ argv[i] = (char*)malloc(env->GetStringUTFLength(jstringArgv[i]) + 1);
+ const char *str = env->GetStringUTFChars(jstringArgv[i], NULL);
+ strcpy(argv[i], str); //copy it to a mutable location
+ env->ReleaseStringUTFChars(jstringArgv[i], str);
}
-
+
/* Run the application code! */
int status = SDL_main(argc, argv);
//Clean up argv
for(int i = 0; i < argc; i++){
- free(argv[i]);
+ free(argv[i]);
}
}
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk
--- a/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk Tue Jan 21 22:43:06 2014 +0100
@@ -5,9 +5,9 @@
LOCAL_MODULE := SDL_mixer
LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/.. \
- $(LOCAL_PATH)/../SDL/include \
- $(LOCAL_PATH)/../mikmod/include \
+ $(LOCAL_PATH)/.. \
+ $(LOCAL_PATH)/../SDL/include \
+ $(LOCAL_PATH)/../mikmod/include \
LOCAL_CFLAGS := -DWAV_MUSIC -DOGG_MUSIC -DOGG_USE_TREMOR -DMOD_MUSIC
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/jni/jnidispatch/Android.mk
--- a/project_files/Android-build/SDL-android-project/jni/jnidispatch/Android.mk Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/jnidispatch/Android.mk Tue Jan 21 22:43:06 2014 +0100
@@ -1,6 +1,6 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libjnidispatch
-LOCAL_SRC_FILES := libjnidispatch.so
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libjnidispatch
+LOCAL_SRC_FILES := libjnidispatch.so
include $(PREBUILT_SHARED_LIBRARY)
\ No newline at end of file
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/jni/src/Android.mk
--- a/project_files/Android-build/SDL-android-project/jni/src/Android.mk Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/src/Android.mk Tue Jan 21 22:43:06 2014 +0100
@@ -7,7 +7,7 @@
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../SDL/include
# Add your application source files here...
-LOCAL_SRC_FILES := ../SDL/src/main/android/SDL_android_main.cpp hedgewars_main.c
+LOCAL_SRC_FILES := ../SDL/src/main/android/SDL_android_main.cpp hedgewars_main.c
LOCAL_SHARED_LIBRARIES := SDL
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c
--- a/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c Tue Jan 21 22:43:06 2014 +0100
@@ -10,32 +10,32 @@
typedef (*HWEngine_Game)(int32_t argc, char** argv);
main(int argc, char *argv[]){
- void *handle;
- char *error;
- HWEngine_Game Game;
-
+ void *handle;
+ char *error;
+ HWEngine_Game Game;
+
__android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine being loaded");
- handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL);
- if(!handle){
- __android_log_print(ANDROID_LOG_INFO, TAG, dlerror());
- __android_log_print(ANDROID_LOG_INFO, TAG, "error dlopen");
- exit(EXIT_FAILURE);
- }
- dlerror();
+ handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL);
+ if(!handle){
+ __android_log_print(ANDROID_LOG_INFO, TAG, dlerror());
+ __android_log_print(ANDROID_LOG_INFO, TAG, "error dlopen");
+ exit(EXIT_FAILURE);
+ }
+ dlerror();
__android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine successfully loaded..");
- Game = (HWEngine_Game) dlsym(handle,"Game");
- if((error = dlerror()) != NULL){
- __android_log_print(ANDROID_LOG_INFO, TAG, error);
- __android_log_print(ANDROID_LOG_INFO, TAG, "error dlsym");
- exit(EXIT_FAILURE);
- }
- __android_log_print(ANDROID_LOG_INFO, TAG, "dlsym succeeded");
- Game(argc, argv);
- __android_log_print(ANDROID_LOG_INFO, TAG, "Game() ended");
+ Game = (HWEngine_Game) dlsym(handle,"Game");
+ if((error = dlerror()) != NULL){
+ __android_log_print(ANDROID_LOG_INFO, TAG, error);
+ __android_log_print(ANDROID_LOG_INFO, TAG, "error dlsym");
+ exit(EXIT_FAILURE);
+ }
+ __android_log_print(ANDROID_LOG_INFO, TAG, "dlsym succeeded");
+ Game(argc, argv);
+ __android_log_print(ANDROID_LOG_INFO, TAG, "Game() ended");
- dlclose(handle);
+ dlclose(handle);
}
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/res/raw/team_one.hwt
--- a/project_files/Android-build/SDL-android-project/res/raw/team_one.hwt Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_one.hwt Tue Jan 21 22:43:06 2014 +0100
@@ -1,74 +1,74 @@
-[Team]
-Name=Team 1
-Grave=Bone
-Fort=Lego
-Voicepack=Classic
-Flag=hedgewars
-Difficulty=0
-Rounds=0
-Wins=0
-CampaignProgress=0
-
-[Hedgehog0]
-Name=Leonidas
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog1]
-Name=Pipo
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog2]
-Name=Sonic
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog3]
-Name=Xin
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog4]
-Name=Arnold
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog5]
-Name=Jack
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog6]
-Name=Tom
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog7]
-Name=Goldie
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
+[Team]
+Name=Team 1
+Grave=Bone
+Fort=Lego
+Voicepack=Classic
+Flag=hedgewars
+Difficulty=0
+Rounds=0
+Wins=0
+CampaignProgress=0
+
+[Hedgehog0]
+Name=Leonidas
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog1]
+Name=Pipo
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog2]
+Name=Sonic
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog3]
+Name=Xin
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog4]
+Name=Arnold
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog5]
+Name=Jack
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog6]
+Name=Tom
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog7]
+Name=Goldie
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/res/raw/team_two.hwt
--- a/project_files/Android-build/SDL-android-project/res/raw/team_two.hwt Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_two.hwt Tue Jan 21 22:43:06 2014 +0100
@@ -1,74 +1,74 @@
-[Team]
-Name=Team 2
-Grave=Bone
-Fort=Lego
-Voicepack=Classic
-Flag=cm_binary
-Difficulty=2
-Rounds=0
-Wins=0
-CampaignProgress=0
-
-[Hedgehog0]
-Name=Paris
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog1]
-Name=Knut
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog2]
-Name=Ash
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog3]
-Name=Woad
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog4]
-Name=Bob
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog5]
-Name=Corky
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog6]
-Name=Bea
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
-
-[Hedgehog7]
-Name=Silvia
-Hat=NoHat
-Rounds=0
-Kills=0
-Deaths=0
-Suicides=0
+[Team]
+Name=Team 2
+Grave=Bone
+Fort=Lego
+Voicepack=Classic
+Flag=cm_binary
+Difficulty=2
+Rounds=0
+Wins=0
+CampaignProgress=0
+
+[Hedgehog0]
+Name=Paris
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog1]
+Name=Knut
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog2]
+Name=Ash
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog3]
+Name=Woad
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog4]
+Name=Bob
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog5]
+Name=Corky
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog6]
+Name=Bea
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
+
+[Hedgehog7]
+Name=Silvia
+Hat=NoHat
+Rounds=0
+Kills=0
+Deaths=0
+Suicides=0
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/res/raw/weapons_builtin.ini
--- a/project_files/Android-build/SDL-android-project/res/raw/weapons_builtin.ini Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapons_builtin.ini Tue Jan 21 22:43:06 2014 +0100
@@ -1,8 +1,8 @@
-[General]
-%44efault=9391929422199121032235111001201000000211110101011111011040504054160065554655446477657666666615551010111541101100000000000002055000000400070040000000002200000006000001311110312111111123114111111111111111211111101111111010
-%43razy=9999999999999999992999999999999999299999999909999992099111111011111111111111111111111111111111111110111111101100000000000000000000000000000000000000000000000000000001311110312111111123114111111111111111211110101111111011
-%50ro%20%4dode=9090009000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002055000000400070040000000002000000000000001111111111111111111111111111111111111111100101111111011
-%53hoppa=0000009900000000000000000000000000000000000000000000000444441004424440221011212122242200000000200040001001100000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111101101111111001
-%43lean%20%53late=1010009000010000011000000000000000000000000000001000000040504054160065554655446477657666666615551010111541101100000000000000000000000000000000000000000000000000000001311110312111111123114111111111111111211111101111111011
-%4dinefield=0000009900090000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002055000000400070040000000002000000006000001111111111111111111111111111111111111111111101111111011
-%54hinking%20with%20%50ortals=9000009002000000002100000000000000110000090000000000000040504054160065554655446477657666666615551010111541101100000000000002055000000400070040000000002000000006000001311110312111111123114111111111111111211111101111111011
+[General]
+%44efault=9391929422199121032235111001201000000211110101011111011040504054160065554655446477657666666615551010111541101100000000000002055000000400070040000000002200000006000001311110312111111123114111111111111111211111101111111010
+%43razy=9999999999999999992999999999999999299999999909999992099111111011111111111111111111111111111111111110111111101100000000000000000000000000000000000000000000000000000001311110312111111123114111111111111111211110101111111011
+%50ro%20%4dode=9090009000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002055000000400070040000000002000000000000001111111111111111111111111111111111111111100101111111011
+%53hoppa=0000009900000000000000000000000000000000000000000000000444441004424440221011212122242200000000200040001001100000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111101101111111001
+%43lean%20%53late=1010009000010000011000000000000000000000000000001000000040504054160065554655446477657666666615551010111541101100000000000000000000000000000000000000000000000000000001311110312111111123114111111111111111211111101111111011
+%4dinefield=0000009900090000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002055000000400070040000000002000000006000001111111111111111111111111111111111111111111101111111011
+%54hinking%20with%20%50ortals=9000009002000000002100000000000000110000090000000000000040504054160065554655446477657666666615551010111541101100000000000002055000000400070040000000002000000006000001311110312111111123114111111111111111211111101111111011
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/BasicRoomState.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/BasicRoomState.java Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/BasicRoomState.java Tue Jan 21 22:43:06 2014 +0100
@@ -37,125 +37,125 @@
* Common base implementation for a roomstate that will call listeners on every
* change. The derived classes have to coordinate how state is changed to
* complete the implementation of the RoomStateManager interface.
- *
+ *
* See {@link RoomStateManager} for a description of what this is for.
*/
public abstract class BasicRoomState implements RoomStateManager {
- private final List observers = new LinkedList();
-
- private boolean chief;
- private String gameStyle;
- private Scheme scheme;
- private MapRecipe map;
- private Weaponset weaponset;
- private Map teams = Collections.emptyMap();
-
- public final MapRecipe getMapRecipe() {
- return map;
- }
+ private final List observers = new LinkedList();
+
+ private boolean chief;
+ private String gameStyle;
+ private Scheme scheme;
+ private MapRecipe map;
+ private Weaponset weaponset;
+ private Map teams = Collections.emptyMap();
+
+ public final MapRecipe getMapRecipe() {
+ return map;
+ }
+
+ public final boolean getChiefStatus() {
+ return chief;
+ }
+
+ public final Scheme getScheme() {
+ return scheme;
+ }
+
+ public final String getGameStyle() {
+ return gameStyle;
+ }
- public final boolean getChiefStatus() {
- return chief;
- }
+ public final Weaponset getWeaponset() {
+ return weaponset;
+ }
+
+ public final Map getTeams() {
+ return teams;
+ }
- public final Scheme getScheme() {
- return scheme;
- }
+ public final void setWeaponset(Weaponset weaponset) {
+ if(!equal(weaponset, this.weaponset)) {
+ this.weaponset = weaponset;
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onWeaponsetChanged(weaponset);
+ }
+ }
+ }
- public final String getGameStyle() {
- return gameStyle;
- }
+ public final void setMapRecipe(MapRecipe map) {
+ if(!equal(map, this.map)) {
+ this.map = map;
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onMapChanged(map);
+ }
+ }
+ }
- public final Weaponset getWeaponset() {
- return weaponset;
- }
-
- public final Map getTeams() {
- return teams;
- }
-
- public final void setWeaponset(Weaponset weaponset) {
- if(!equal(weaponset, this.weaponset)) {
- this.weaponset = weaponset;
- for(RoomStateManager.Listener observer : observers) {
- observer.onWeaponsetChanged(weaponset);
- }
- }
- }
-
- public final void setMapRecipe(MapRecipe map) {
- if(!equal(map, this.map)) {
- this.map = map;
- for(RoomStateManager.Listener observer : observers) {
- observer.onMapChanged(map);
- }
- }
- }
-
- public final void setGameStyle(String gameStyle) {
- if(!equal(gameStyle, this.gameStyle)) {
- this.gameStyle = gameStyle;
- for(RoomStateManager.Listener observer : observers) {
- observer.onGameStyleChanged(gameStyle);
- }
- }
- }
-
- public final void setScheme(Scheme scheme) {
- if(!equal(scheme, this.scheme)) {
- this.scheme = scheme;
- for(RoomStateManager.Listener observer : observers) {
- observer.onSchemeChanged(scheme);
- }
- }
- }
-
- public final void setChief(boolean chief) {
- if(chief != this.chief) {
- this.chief = chief;
- for(RoomStateManager.Listener observer : observers) {
- observer.onChiefStatusChanged(chief);
- }
- }
- }
-
- public final void putTeam(TeamInGame team) {
- TeamInGame oldEntry = teams.get(team.team.name);
- if(!equal(team, oldEntry)) {
- Map changedMap = new TreeMap(teams);
- changedMap.put(team.team.name, team);
- teams = Collections.unmodifiableMap(changedMap);
- for(RoomStateManager.Listener observer : observers) {
- observer.onTeamsChanged(teams);
- }
- }
- }
-
- public final void removeTeam(String teamname) {
- if(teams.containsKey(teamname)) {
- Map changedMap = new TreeMap(teams);
- changedMap.remove(teamname);
- teams = Collections.unmodifiableMap(changedMap);
- for(RoomStateManager.Listener observer : observers) {
- observer.onTeamsChanged(teams);
- }
- }
- }
-
- public final void setTeams(Map newTeams) {
- if(!newTeams.equals(teams)) {
- teams = Collections.unmodifiableMap(new TreeMap(newTeams));
- for(RoomStateManager.Listener observer : observers) {
- observer.onTeamsChanged(teams);
- }
- }
- }
-
- public final void addListener(Listener observer) {
- observers.add(observer);
- }
+ public final void setGameStyle(String gameStyle) {
+ if(!equal(gameStyle, this.gameStyle)) {
+ this.gameStyle = gameStyle;
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onGameStyleChanged(gameStyle);
+ }
+ }
+ }
+
+ public final void setScheme(Scheme scheme) {
+ if(!equal(scheme, this.scheme)) {
+ this.scheme = scheme;
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onSchemeChanged(scheme);
+ }
+ }
+ }
+
+ public final void setChief(boolean chief) {
+ if(chief != this.chief) {
+ this.chief = chief;
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onChiefStatusChanged(chief);
+ }
+ }
+ }
- public final void removeListener(Listener observer) {
- observers.remove(observer);
- }
+ public final void putTeam(TeamInGame team) {
+ TeamInGame oldEntry = teams.get(team.team.name);
+ if(!equal(team, oldEntry)) {
+ Map changedMap = new TreeMap(teams);
+ changedMap.put(team.team.name, team);
+ teams = Collections.unmodifiableMap(changedMap);
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onTeamsChanged(teams);
+ }
+ }
+ }
+
+ public final void removeTeam(String teamname) {
+ if(teams.containsKey(teamname)) {
+ Map changedMap = new TreeMap(teams);
+ changedMap.remove(teamname);
+ teams = Collections.unmodifiableMap(changedMap);
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onTeamsChanged(teams);
+ }
+ }
+ }
+
+ public final void setTeams(Map newTeams) {
+ if(!newTeams.equals(teams)) {
+ teams = Collections.unmodifiableMap(new TreeMap(newTeams));
+ for(RoomStateManager.Listener observer : observers) {
+ observer.onTeamsChanged(teams);
+ }
+ }
+ }
+
+ public final void addListener(Listener observer) {
+ observers.add(observer);
+ }
+
+ public final void removeListener(Listener observer) {
+ observers.remove(observer);
+ }
}
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ChatFragment.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ChatFragment.java Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ChatFragment.java Tue Jan 21 22:43:06 2014 +0100
@@ -39,61 +39,61 @@
* the lobby or a room.
*/
public class ChatFragment extends Fragment {
- private ChatlogAdapter adapter;
- private Netplay netplay;
- private MessageLog messageLog;
- private boolean inRoom;
-
- public void setInRoom(boolean inRoom) {
- this.inRoom = inRoom;
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- netplay = Netplay.getAppInstance(getActivity().getApplicationContext());
- adapter = new ChatlogAdapter(getActivity());
- }
-
- @Override
- public void onStart() {
- super.onStart();
- messageLog = inRoom ? netplay.roomChatlog : netplay.lobbyChatlog;
- adapter.setLog(messageLog.getLog());
- messageLog.addListener(adapter);
- }
-
- @Override
- public void onStop() {
- super.onStop();
- messageLog.removeListener(adapter);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.fragment_chat, container, false);
-
- ListView listView = (ListView) view.findViewById(R.id.chatConsole);
- listView.setAdapter(adapter);
- listView.setDivider(null);
- listView.setDividerHeight(0);
- listView.setVerticalFadingEdgeEnabled(true);
-
- EditText editText = (EditText) view.findViewById(R.id.chatInput);
+ private ChatlogAdapter adapter;
+ private Netplay netplay;
+ private MessageLog messageLog;
+ private boolean inRoom;
+
+ public void setInRoom(boolean inRoom) {
+ this.inRoom = inRoom;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ netplay = Netplay.getAppInstance(getActivity().getApplicationContext());
+ adapter = new ChatlogAdapter(getActivity());
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ messageLog = inRoom ? netplay.roomChatlog : netplay.lobbyChatlog;
+ adapter.setLog(messageLog.getLog());
+ messageLog.addListener(adapter);
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ messageLog.removeListener(adapter);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_chat, container, false);
+
+ ListView listView = (ListView) view.findViewById(R.id.chatConsole);
+ listView.setAdapter(adapter);
+ listView.setDivider(null);
+ listView.setDividerHeight(0);
+ listView.setVerticalFadingEdgeEnabled(true);
+
+ EditText editText = (EditText) view.findViewById(R.id.chatInput);
editText.setOnEditorActionListener(new ChatSendListener());
-
- return view;
- }
-
- private final class ChatSendListener implements OnEditorActionListener {
- public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
- String text = v.getText().toString();
- if(text.length()>0) {
- v.setText("");
- netplay.sendChat(text);
- }
- return true;
- }
- }
+
+ return view;
+ }
+
+ private final class ChatSendListener implements OnEditorActionListener {
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ String text = v.getText().toString();
+ if(text.length()>0) {
+ v.setText("");
+ netplay.sendChat(text);
+ }
+ return true;
+ }
+ }
}
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ChatlogAdapter.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ChatlogAdapter.java Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ChatlogAdapter.java Tue Jan 21 22:43:06 2014 +0100
@@ -39,14 +39,14 @@
* Since lines with a given ID never change in our chatlog, we can avoid the effort
* of TextView.setText in many cases by checking if the view is already set up for the
* line with the right ID - but to do that, the view needs to remember the ID it's
- * holding the text for. That's what the LoglineView does.
+ * holding the text for. That's what the LoglineView does.
*/
class LoglineView extends TextView {
- long chatlogId = -1;
-
- public LoglineView(Context context) {
- super(context);
- }
+ long chatlogId = -1;
+
+ public LoglineView(Context context) {
+ super(context);
+ }
}
/**
@@ -57,65 +57,65 @@
* the textviews from a messagelog in an efficient way.
*/
public class ChatlogAdapter extends BaseAdapter implements MessageLog.Listener {
- long idOffset = 0;
- private List log = new ArrayList();
- private Context context;
-
- public ChatlogAdapter(Context context) {
- this.context = context;
- }
-
- public int getCount() {
- return log.size();
- }
+ long idOffset = 0;
+ private List log = new ArrayList();
+ private Context context;
+
+ public ChatlogAdapter(Context context) {
+ this.context = context;
+ }
+
+ public int getCount() {
+ return log.size();
+ }
- public Object getItem(int position) {
- return log.get(position);
- }
+ public Object getItem(int position) {
+ return log.get(position);
+ }
+
+ public long getItemId(int position) {
+ return position+idOffset;
+ }
- public long getItemId(int position) {
- return position+idOffset;
- }
+ public boolean hasStableIds() {
+ return true;
+ }
- public boolean hasStableIds() {
- return true;
- }
+ public void clear() {
+ idOffset += log.size();
+ log.clear();
+ notifyDataSetChanged();
+ }
- public void clear() {
- idOffset += log.size();
- log.clear();
- notifyDataSetChanged();
- }
-
- public void lineAdded(CharSequence text) {
- log.add(text);
- notifyDataSetChanged();
- }
-
- public void lineRemoved() {
- log.remove(0);
- idOffset += 1;
- notifyDataSetChanged();
- }
-
- public void setLog(Collection log) {
- idOffset += log.size();
- this.log = new ArrayList(log);
- notifyDataSetChanged();
- }
-
- public View getView(int position, View convertView, ViewGroup parent) {
- LoglineView v = (LoglineView)convertView;
- if (v == null) {
- v = new LoglineView(context);
- v.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
- v.setMovementMethod(LinkMovementMethod.getInstance());
- }
- long id = getItemId(position);
- if(id != v.chatlogId) {
- v.setText(log.get(position));
- v.chatlogId = id;
- }
- return v;
- }
+ public void lineAdded(CharSequence text) {
+ log.add(text);
+ notifyDataSetChanged();
+ }
+
+ public void lineRemoved() {
+ log.remove(0);
+ idOffset += 1;
+ notifyDataSetChanged();
+ }
+
+ public void setLog(Collection log) {
+ idOffset += log.size();
+ this.log = new ArrayList(log);
+ notifyDataSetChanged();
+ }
+
+ public View getView(int position, View convertView, ViewGroup parent) {
+ LoglineView v = (LoglineView)convertView;
+ if (v == null) {
+ v = new LoglineView(context);
+ v.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ v.setMovementMethod(LinkMovementMethod.getInstance());
+ }
+ long id = getItemId(position);
+ if(id != v.chatlogId) {
+ v.setText(log.get(position));
+ v.chatlogId = id;
+ }
+ return v;
+ }
}
\ No newline at end of file
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ConnectingDialog.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ConnectingDialog.java Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ConnectingDialog.java Tue Jan 21 22:43:06 2014 +0100
@@ -37,58 +37,58 @@
* Indeterminate progress dialog that is shown in the MainActivity while trying
* to connect to the server. If the connection fails (disconnect before we reach
* lobby state), an error toast with the disconnect message is shown.
- *
+ *
*/
public class ConnectingDialog extends ConnectionDependendDialogFragment {
- @Override
- public void onStart() {
- super.onStart();
- LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).registerReceiver(connectedReceiver, new IntentFilter(Netplay.ACTION_CONNECTED));
- LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).registerReceiver(disconnectedReceiver, new IntentFilter(Netplay.ACTION_DISCONNECTED));
-
- if(Netplay.getAppInstance(getActivity().getApplicationContext()).getState() != State.CONNECTING) {
- dismiss();
- }
- }
-
- @Override
- public void onStop() {
- super.onStop();
- LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).unregisterReceiver(connectedReceiver);
- LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).unregisterReceiver(disconnectedReceiver);
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- ProgressDialog dialog = new ProgressDialog(getActivity());
- dialog.setIndeterminate(true);
- dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
- dialog.setTitle(R.string.dialog_connecting_title);
- dialog.setMessage(getString(R.string.dialog_connecting_message));
- return dialog;
- }
-
- private BroadcastReceiver connectedReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- Dialog dialog = getDialog();
- if(dialog != null) {
- dialog.dismiss();
- } else {
- dismiss();
- }
- }
- };
-
- private BroadcastReceiver disconnectedReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- Toast.makeText(getActivity(), intent.getExtras().getString(Netplay.EXTRA_MESSAGE), Toast.LENGTH_LONG).show();
- }
- };
-
- public void onCancel(DialogInterface dialog) {
- super.onCancel(dialog);
- Netplay.getAppInstance(getActivity().getApplicationContext()).disconnect();
- };
+ @Override
+ public void onStart() {
+ super.onStart();
+ LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).registerReceiver(connectedReceiver, new IntentFilter(Netplay.ACTION_CONNECTED));
+ LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).registerReceiver(disconnectedReceiver, new IntentFilter(Netplay.ACTION_DISCONNECTED));
+
+ if(Netplay.getAppInstance(getActivity().getApplicationContext()).getState() != State.CONNECTING) {
+ dismiss();
+ }
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).unregisterReceiver(connectedReceiver);
+ LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).unregisterReceiver(disconnectedReceiver);
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ ProgressDialog dialog = new ProgressDialog(getActivity());
+ dialog.setIndeterminate(true);
+ dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ dialog.setTitle(R.string.dialog_connecting_title);
+ dialog.setMessage(getString(R.string.dialog_connecting_message));
+ return dialog;
+ }
+
+ private BroadcastReceiver connectedReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Dialog dialog = getDialog();
+ if(dialog != null) {
+ dialog.dismiss();
+ } else {
+ dismiss();
+ }
+ }
+ };
+
+ private BroadcastReceiver disconnectedReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Toast.makeText(getActivity(), intent.getExtras().getString(Netplay.EXTRA_MESSAGE), Toast.LENGTH_LONG).show();
+ }
+ };
+
+ public void onCancel(DialogInterface dialog) {
+ super.onCancel(dialog);
+ Netplay.getAppInstance(getActivity().getApplicationContext()).disconnect();
+ };
}
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ConnectionDependendDialogFragment.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ConnectionDependendDialogFragment.java Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/ConnectionDependendDialogFragment.java Tue Jan 21 22:43:06 2014 +0100
@@ -36,30 +36,30 @@
* appear during connecting (e.g. username input)
*/
public class ConnectionDependendDialogFragment extends DialogFragment {
- @Override
- public void onStart() {
- super.onStart();
- LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).registerReceiver(dismissReceiver, new IntentFilter(Netplay.ACTION_DISCONNECTED));
- if(Netplay.getAppInstance(getActivity().getApplicationContext()).getState() == State.NOT_CONNECTED) {
- dismiss();
- }
- }
-
- @Override
- public void onStop() {
- super.onStop();
- LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).unregisterReceiver(dismissReceiver);
- }
-
- private BroadcastReceiver dismissReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- Dialog dialog = getDialog();
- if(dialog != null) {
- dialog.dismiss();
- } else {
- dismiss();
- }
- }
- };
+ @Override
+ public void onStart() {
+ super.onStart();
+ LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).registerReceiver(dismissReceiver, new IntentFilter(Netplay.ACTION_DISCONNECTED));
+ if(Netplay.getAppInstance(getActivity().getApplicationContext()).getState() == State.NOT_CONNECTED) {
+ dismiss();
+ }
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ LocalBroadcastManager.getInstance(getActivity().getApplicationContext()).unregisterReceiver(dismissReceiver);
+ }
+
+ private BroadcastReceiver dismissReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Dialog dialog = getDialog();
+ if(dialog != null) {
+ dialog.dismiss();
+ } else {
+ dismiss();
+ }
+ }
+ };
}
diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java Tue Jan 21 22:38:13 2014 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java Tue Jan 21 22:43:06 2014 +0100
@@ -36,48 +36,48 @@
import android.util.Log;
public class DownloadAssets extends AsyncTask