Silence ALL the compile warnings!

This commit is contained in:
Thulinma 2014-06-08 00:19:53 +02:00
parent c6e86a697b
commit b5745727a0
10 changed files with 22 additions and 24 deletions

View file

@ -297,7 +297,7 @@ namespace Mist {
it->second.curOffset = 0; it->second.curOffset = 0;
getNext(); getNext();
//in case earlier seeking was inprecise, seek to the exact point //in case earlier seeking was inprecise, seek to the exact point
while (lastPack && lastPack.getTime() < myMeta.tracks[track].keys[pageNum-1].getTime()){ while (lastPack && lastPack.getTime() < (unsigned long long)myMeta.tracks[track].keys[pageNum-1].getTime()){
getNext(); getNext();
} }
while (lastPack && lastPack.getTime() < stopTime){ while (lastPack && lastPack.getTime() < stopTime){
@ -320,7 +320,7 @@ namespace Mist {
} }
bool Input::atKeyFrame(){ bool Input::atKeyFrame(){
static std::map<int, int> lastSeen; static std::map<int, unsigned long long> lastSeen;
//not in keyTimes? We're not at a keyframe. //not in keyTimes? We're not at a keyframe.
unsigned int c = keyTimes[lastPack.getTrackId()].count(lastPack.getTime()); unsigned int c = keyTimes[lastPack.getTrackId()].count(lastPack.getTime());
if (!c){ if (!c){

View file

@ -80,7 +80,7 @@ namespace Mist {
if (myMeta.tracks[tid].keys[0].getNumber() >= (++(inputLoc[tid].begin()))->first){ if (myMeta.tracks[tid].keys[0].getNumber() >= (++(inputLoc[tid].begin()))->first){
//Find page in indexpage and null it //Find page in indexpage and null it
for (int i = 0; i < 8192; i += 8){ for (int i = 0; i < 8192; i += 8){
int thisKeyNum = ((((long long int *)(indexPages[tid].mapped + i))[0]) >> 32) & 0xFFFFFFFF; unsigned int thisKeyNum = ((((long long int *)(indexPages[tid].mapped + i))[0]) >> 32) & 0xFFFFFFFF;
if (thisKeyNum == htonl(pagesByTrack[tid].begin()->first) && ((((long long int *)(indexPages[tid].mapped + i))[0]) != 0)){ if (thisKeyNum == htonl(pagesByTrack[tid].begin()->first) && ((((long long int *)(indexPages[tid].mapped + i))[0]) != 0)){
(((long long int *)(indexPages[tid].mapped + i))[0]) = 0; (((long long int *)(indexPages[tid].mapped + i))[0]) = 0;
} }
@ -249,7 +249,7 @@ namespace Mist {
dataPages[value][nextPage].init(nextPageName, 20971520, true); dataPages[value][nextPage].init(nextPageName, 20971520, true);
bool createdNew = false; bool createdNew = false;
for (int i = 0; i < 8192; i += 8){ for (int i = 0; i < 8192; i += 8){
int thisKeyNum = ((((long long int *)(indexPages[value].mapped + i))[0]) >> 32) & 0xFFFFFFFF; unsigned int thisKeyNum = ((((long long int *)(indexPages[value].mapped + i))[0]) >> 32) & 0xFFFFFFFF;
if (thisKeyNum == htonl(currentPage)){ if (thisKeyNum == htonl(currentPage)){
if((ntohl((((long long int*)(indexPages[value].mapped + i))[0]) & 0xFFFFFFFF) == 1000)){ if((ntohl((((long long int*)(indexPages[value].mapped + i))[0]) & 0xFFFFFFFF) == 1000)){
((long long int *)(indexPages[value].mapped + i))[0] &= 0xFFFFFFFF00000000ull; ((long long int *)(indexPages[value].mapped + i))[0] &= 0xFFFFFFFF00000000ull;

View file

@ -110,7 +110,7 @@ namespace Mist {
//Flv files are never multi-track, so track 1 is video, track 2 is audio. //Flv files are never multi-track, so track 1 is video, track 2 is audio.
int trackSeek = (selectedTracks.count(1) ? 1 : 2); int trackSeek = (selectedTracks.count(1) ? 1 : 2);
size_t seekPos = myMeta.tracks[trackSeek].keys[0].getBpos(); size_t seekPos = myMeta.tracks[trackSeek].keys[0].getBpos();
for (int i = 0; i < myMeta.tracks[trackSeek].keys.size(); i++){ for (unsigned int i = 0; i < myMeta.tracks[trackSeek].keys.size(); i++){
if (myMeta.tracks[trackSeek].keys[i].getTime() > seekTime){ if (myMeta.tracks[trackSeek].keys[i].getTime() > seekTime){
break; break;
} }
@ -121,7 +121,7 @@ namespace Mist {
void inputFLV::trackSelect(std::string trackSpec) { void inputFLV::trackSelect(std::string trackSpec) {
selectedTracks.clear(); selectedTracks.clear();
long long int index; size_t index;
while (trackSpec != "") { while (trackSpec != "") {
index = trackSpec.find(' '); index = trackSpec.find(' ');
selectedTracks.insert(atoi(trackSpec.substr(0, index).c_str())); selectedTracks.insert(atoi(trackSpec.substr(0, index).c_str()));

View file

@ -265,11 +265,11 @@ namespace Mist {
void inputOGG::trackSelect(std::string trackSpec) { void inputOGG::trackSelect(std::string trackSpec) {
selectedTracks.clear(); selectedTracks.clear();
long long int index; size_t index;
while (trackSpec != "") { while (trackSpec != "") {
index = trackSpec.find(' '); index = trackSpec.find(' ');
selectedTracks.insert(atoi(trackSpec.substr(0, index).c_str())); selectedTracks.insert(atoi(trackSpec.substr(0, index).c_str()));
DEBUG_MSG(DLVL_WARN, "Added track %d, index = %lld, (index == npos) = %d", atoi(trackSpec.substr(0, index).c_str()), index, index == std::string::npos); DEBUG_MSG(DLVL_WARN, "Added track %d, index = %lu, (index == npos) = %d", atoi(trackSpec.substr(0, index).c_str()), index, index == std::string::npos);
if (index != std::string::npos) { if (index != std::string::npos) {
trackSpec.erase(0, index + 1); trackSpec.erase(0, index + 1);
} else { } else {

View file

@ -20,7 +20,7 @@ namespace Mist {
return ntohl(((int*)(mapped + offset))[1]); return ntohl(((int*)(mapped + offset))[1]);
} }
long long int getDTSCTime(char * mapped, long long int offset){ unsigned long long getDTSCTime(char * mapped, long long int offset){
char * timePoint = mapped + offset + 12; char * timePoint = mapped + offset + 12;
return ((long long int)timePoint[0] << 56) | ((long long int)timePoint[1] << 48) | ((long long int)timePoint[2] << 40) | ((long long int)timePoint[3] << 32) | ((long long int)timePoint[4] << 24) | ((long long int)timePoint[5] << 16) | ((long long int)timePoint[6] << 8) | timePoint[7]; return ((long long int)timePoint[0] << 56) | ((long long int)timePoint[1] << 48) | ((long long int)timePoint[2] << 40) | ((long long int)timePoint[3] << 32) | ((long long int)timePoint[4] << 24) | ((long long int)timePoint[5] << 16) | ((long long int)timePoint[6] << 8) | timePoint[7];
} }
@ -106,8 +106,8 @@ namespace Mist {
tmp[6 * bufConnOffset + 4] = 0xFF; tmp[6 * bufConnOffset + 4] = 0xFF;
tmp[6 * bufConnOffset + 5] = 0xFF; tmp[6 * bufConnOffset + 5] = 0xFF;
playerConn.keepAlive(); playerConn.keepAlive();
int newTid = 0x80000000; unsigned int newTid = 0x80000000u;
while (newTid == 0x80000000){ while (newTid == 0x80000000u){
Util::sleep(100); Util::sleep(100);
newTid = ((long)(tmp[6 * bufConnOffset]) << 24) | ((long)(tmp[6 * bufConnOffset + 1]) << 16) | ((long)(tmp[6 * bufConnOffset + 2]) << 8) | tmp[6 * bufConnOffset + 3]; newTid = ((long)(tmp[6 * bufConnOffset]) << 24) | ((long)(tmp[6 * bufConnOffset + 1]) << 16) | ((long)(tmp[6 * bufConnOffset + 2]) << 8) | tmp[6 * bufConnOffset + 3];
} }
@ -202,7 +202,7 @@ namespace Mist {
bookKeeping[tNum].keyNum = 0; bookKeeping[tNum].keyNum = 0;
bookKeeping[tNum].curOffset = 0; bookKeeping[tNum].curOffset = 0;
} }
if (bookKeeping[tNum].curOffset + tmp.size() < curPages[tNum].len){ if (bookKeeping[tNum].curOffset + tmp.size() < (unsigned long long)curPages[tNum].len){
bookKeeping[tNum].keyNum += (pack.isMember("keyframe") && pack["keyframe"]); bookKeeping[tNum].keyNum += (pack.isMember("keyframe") && pack["keyframe"]);
memcpy(curPages[tNum].mapped + bookKeeping[tNum].curOffset, tmp.data(), tmp.size()); memcpy(curPages[tNum].mapped + bookKeeping[tNum].curOffset, tmp.data(), tmp.size());
bookKeeping[tNum].curOffset += tmp.size(); bookKeeping[tNum].curOffset += tmp.size();
@ -424,7 +424,7 @@ namespace Mist {
stats(); stats();
nxtKeyNum[trackId] = pageNum; nxtKeyNum[trackId] = pageNum;
if (currKeyOpen.count(trackId) && currKeyOpen[trackId] == pageNum){ if (currKeyOpen.count(trackId) && currKeyOpen[trackId] == (unsigned int)pageNum){
return; return;
} }
char id[100]; char id[100];

View file

@ -199,7 +199,7 @@ namespace Mist {
if (!audioTrack){getTracks();} if (!audioTrack){getTracks();}
unsigned int mstime = 0; unsigned int mstime = 0;
unsigned int mslen = 0; unsigned int mslen = 0;
if (fragNum < myMeta.tracks[tid].missedFrags){ if (fragNum < (unsigned int)myMeta.tracks[tid].missedFrags){
HTTP_S.Clean(); HTTP_S.Clean();
HTTP_S.SetBody("The requested fragment is no longer kept in memory on the server and cannot be served.\n"); HTTP_S.SetBody("The requested fragment is no longer kept in memory on the server and cannot be served.\n");
HTTP_S.SendResponse("412", "Fragment out of range", myConn); HTTP_S.SendResponse("412", "Fragment out of range", myConn);

View file

@ -102,12 +102,12 @@ namespace Mist {
for (std::set<unsigned long>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++) { for (std::set<unsigned long>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++) {
//return "too late" if one track is past this point //return "too late" if one track is past this point
if (ms < myMeta.tracks[*it].firstms) { if (ms < myMeta.tracks[*it].firstms) {
DEBUG_MSG(DLVL_DEVEL, "HSS Canseek to %d returns -1 because track %lu firstms == %d", ms, *it, myMeta.tracks[*it].firstms); DEBUG_MSG(DLVL_DEVEL, "HSS Canseek to %d returns -1 because track %lu firstms == %llu", ms, *it, myMeta.tracks[*it].firstms);
return -1; return -1;
} }
//return "too early" if one track is not yet at this point //return "too early" if one track is not yet at this point
if (ms > myMeta.tracks[*it].lastms) { if (ms > myMeta.tracks[*it].lastms) {
DEBUG_MSG(DLVL_DEVEL, "HSS Canseek to %d returns 1 because track %lu lastms == %d", ms, *it, myMeta.tracks[*it].lastms); DEBUG_MSG(DLVL_DEVEL, "HSS Canseek to %d returns 1 because track %lu lastms == %llu", ms, *it, myMeta.tracks[*it].lastms);
return 1; return 1;
} }
} }
@ -171,12 +171,10 @@ namespace Mist {
std::stringstream sstream; std::stringstream sstream;
int partOffset = 0; int partOffset = 0;
int keyDur = 0;
DTSC::Key keyObj; DTSC::Key keyObj;
for (std::deque<DTSC::Key>::iterator it = myMeta.tracks[tid].keys.begin(); it != myMeta.tracks[tid].keys.end(); it++) { for (std::deque<DTSC::Key>::iterator it = myMeta.tracks[tid].keys.begin(); it != myMeta.tracks[tid].keys.end(); it++) {
if (it->getTime() >= seekTime) { if (it->getTime() >= seekTime) {
keyObj = (*it); keyObj = (*it);
keyDur = it->getLength();
std::deque<DTSC::Key>::iterator nextIt = it; std::deque<DTSC::Key>::iterator nextIt = it;
nextIt++; nextIt++;
if (nextIt == myMeta.tracks[tid].keys.end()) { if (nextIt == myMeta.tracks[tid].keys.end()) {

View file

@ -22,7 +22,7 @@ namespace Mist {
int keysToSend; int keysToSend;
int myTrackStor; int myTrackStor;
int myKeyStor; int myKeyStor;
long long int playUntil; unsigned long long playUntil;
}; };
} }

View file

@ -43,10 +43,10 @@ namespace Mist {
long long int firstms = -1; long long int firstms = -1;
long long int lastms = -1; long long int lastms = -1;
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++) { for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++) {
if (lastms == -1 || lastms < myMeta.tracks[*it].lastms){ if (lastms == -1 || lastms < (long long)myMeta.tracks[*it].lastms){
lastms = myMeta.tracks[*it].lastms; lastms = myMeta.tracks[*it].lastms;
} }
if (firstms == -1 || firstms > myMeta.tracks[*it].firstms){ if (firstms == -1 || firstms > (long long)myMeta.tracks[*it].firstms){
firstms = myMeta.tracks[*it].firstms; firstms = myMeta.tracks[*it].firstms;
} }
} }
@ -438,7 +438,7 @@ namespace Mist {
char * dataPointer = 0; char * dataPointer = 0;
unsigned int len = 0; unsigned int len = 0;
currentPacket.getString("data", dataPointer, len); currentPacket.getString("data", dataPointer, len);
if (currentPacket.getTrackId() != sortSet.begin()->trackID || currentPacket.getTime() != sortSet.begin()->time){ if ((unsigned long)currentPacket.getTrackId() != sortSet.begin()->trackID || currentPacket.getTime() != sortSet.begin()->time){
if (perfect){ if (perfect){
DEBUG_MSG(DLVL_WARN, "Warning: input is inconsistent, playback may not be perfect"); DEBUG_MSG(DLVL_WARN, "Warning: input is inconsistent, playback may not be perfect");
perfect = false; perfect = false;

View file

@ -42,11 +42,11 @@ namespace Mist {
} }
long long unsigned int time = currentPacket.getTime(); long long unsigned int time = currentPacket.getTime();
char tmpBuf[50]; char tmpBuf[50];
int tmpLen = sprintf(tmpBuf, "%0.2llu:%0.2llu:%0.2llu,%0.3llu", (time / 3600000), ((time % 3600000) / 60000), (((time % 3600000) % 60000) / 1000), time % 1000); int tmpLen = sprintf(tmpBuf, "%.2llu:%.2llu:%.2llu,%.3llu", (time / 3600000), ((time % 3600000) / 60000), (((time % 3600000) % 60000) / 1000), time % 1000);
tmp.write(tmpBuf, tmpLen); tmp.write(tmpBuf, tmpLen);
tmp << " --> "; tmp << " --> ";
time += currentPacket.getInt("duration"); time += currentPacket.getInt("duration");
tmpLen = sprintf(tmpBuf, "%0.2llu:%0.2llu:%0.2llu,%0.3llu", (time / 3600000), ((time % 3600000) / 60000), (((time % 3600000) % 60000) / 1000), time % 1000); tmpLen = sprintf(tmpBuf, "%.2llu:%.2llu:%.2llu,%.3llu", (time / 3600000), ((time % 3600000) / 60000), (((time % 3600000) % 60000) / 1000), time % 1000);
tmp.write(tmpBuf, tmpLen); tmp.write(tmpBuf, tmpLen);
tmp << std::endl; tmp << std::endl;
myConn.SendNow(tmp.str()); myConn.SendNow(tmp.str());