1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Replaced 'unsigned long long' with 'uint32_t' and 'uint64' with 'uint64_t' to avoid problems on 64-bit machines

This commit is contained in:
Klaus Schmidinger 2006-12-02 11:30:19 +01:00
parent 661da094e1
commit 19f39258f0
8 changed files with 33 additions and 31 deletions

View File

@ -4986,7 +4986,7 @@ Video Disk Recorder Revision History
- Fixed displaying the replay mode symbol in case of "Multi speed mode" (reported - Fixed displaying the replay mode symbol in case of "Multi speed mode" (reported
by Marco Schlüßler). by Marco Schlüßler).
2006-12-01: Version 1.4.4-1 2006-12-02: Version 1.4.4-1
- Some improvements to the man pages (thanks to Ville Skyttä). - Some improvements to the man pages (thanks to Ville Skyttä).
- Fixed a possible segfault in cSkins::Message() (thanks to Udo Richter). - Fixed a possible segfault in cSkins::Message() (thanks to Udo Richter).
@ -5006,3 +5006,5 @@ Video Disk Recorder Revision History
and waiting for 5 minutes before calling it again (thanks to Jörg Wendel for and waiting for 5 minutes before calling it again (thanks to Jörg Wendel for
reporting that cPlugin::Active() was called too often, and to Udo Richter for reporting that cPlugin::Active() was called too often, and to Udo Richter for
some hints on how to improve this). some hints on how to improve this).
- Replaced 'unsigned long long' with 'uint32_t' and 'uint64' with 'uint64_t' to
avoid problems on 64-bit machines.

4
font.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: font.h 1.12 2006/02/05 13:46:36 kls Exp $ * $Id: font.h 1.13 2006/12/02 11:11:48 kls Exp $
*/ */
#ifndef __FONT_H #ifndef __FONT_H
@ -32,7 +32,7 @@ enum eDvbCode {
class cFont { class cFont {
public: public:
enum { NUMCHARS = 256 }; enum { NUMCHARS = 256 };
typedef unsigned long tPixelData; typedef uint32_t tPixelData;
struct tCharData { struct tCharData {
tPixelData width, height; tPixelData width, height;
tPixelData lines[1]; tPixelData lines[1];

4
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.445 2006/11/04 13:13:18 kls Exp $ * $Id: menu.c 1.446 2006/12/02 11:12:02 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -3280,7 +3280,7 @@ eOSState cDisplayChannel::ProcessKey(eKeys Key)
return osEnd; return osEnd;
} }
}; };
if (!timeout || lastTime.Elapsed() < (uint64)(Setup.ChannelInfoTime * 1000)) { if (!timeout || lastTime.Elapsed() < (uint64_t)(Setup.ChannelInfoTime * 1000)) {
if (Key == kNone && !number && group < 0 && !NewChannel && channel && channel->Number() != cDevice::CurrentChannel()) { if (Key == kNone && !number && group < 0 && !NewChannel && channel && channel->Number() != cDevice::CurrentChannel()) {
// makes sure a channel switch through the SVDRP CHAN command is displayed // makes sure a channel switch through the SVDRP CHAN command is displayed
channel = Channels.GetByNumber(cDevice::CurrentChannel()); channel = Channels.GetByNumber(cDevice::CurrentChannel());

8
rcu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: rcu.c 1.14 2006/06/16 09:29:24 kls Exp $ * $Id: rcu.c 1.15 2006/12/02 11:12:28 kls Exp $
*/ */
#include "rcu.h" #include "rcu.h"
@ -97,7 +97,7 @@ void cRcuRemote::Action(void)
time_t LastCodeRefresh = 0; time_t LastCodeRefresh = 0;
cTimeMs FirstTime; cTimeMs FirstTime;
unsigned char LastCode = 0, LastMode = 0; unsigned char LastCode = 0, LastMode = 0;
uint64 LastCommand = ~0; // 0x00 might be a valid command uint64_t LastCommand = ~0; // 0x00 might be a valid command
unsigned int LastData = 0; unsigned int LastData = 0;
bool repeat = false; bool repeat = false;
@ -109,13 +109,13 @@ void cRcuRemote::Action(void)
buffer.raw[i] = b; buffer.raw[i] = b;
if (i == 5) { if (i == 5) {
unsigned short Address = ntohs(buffer.data.address); // the PIC sends bytes in "network order" unsigned short Address = ntohs(buffer.data.address); // the PIC sends bytes in "network order"
uint64 Command = ntohl(buffer.data.command); uint64_t Command = ntohl(buffer.data.command);
if (code == 'B' && Address == 0x0000 && Command == 0x00004000) if (code == 'B' && Address == 0x0000 && Command == 0x00004000)
// Well, well, if it isn't the "d-box"... // Well, well, if it isn't the "d-box"...
// This remote control sends the above command before and after // This remote control sends the above command before and after
// each keypress - let's just drop this: // each keypress - let's just drop this:
break; break;
Command |= uint64(Address) << 32; Command |= uint64_t(Address) << 32;
if (Command != LastCommand) { if (Command != LastCommand) {
LastCommand = Command; LastCommand = Command;
repeat = false; repeat = false;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: remote.c 1.54 2006/10/14 11:05:57 kls Exp $ * $Id: remote.c 1.55 2006/12/02 11:12:42 kls Exp $
*/ */
#include "remote.h" #include "remote.h"
@ -116,7 +116,7 @@ bool cRemote::PutMacro(eKeys Key)
return true; return true;
} }
bool cRemote::Put(uint64 Code, bool Repeat, bool Release) bool cRemote::Put(uint64_t Code, bool Repeat, bool Release)
{ {
char buffer[32]; char buffer[32];
snprintf(buffer, sizeof(buffer), "%016LX", Code); snprintf(buffer, sizeof(buffer), "%016LX", Code);
@ -203,7 +203,7 @@ cRemotes Remotes;
struct tKbdMap { struct tKbdMap {
eKbdFunc func; eKbdFunc func;
uint64 code; uint64_t code;
}; };
static tKbdMap KbdMap[] = { static tKbdMap KbdMap[] = {
@ -264,7 +264,7 @@ void cKbdRemote::SetRawMode(bool RawMode)
rawMode = RawMode; rawMode = RawMode;
} }
uint64 cKbdRemote::MapFuncToCode(int Func) uint64_t cKbdRemote::MapFuncToCode(int Func)
{ {
for (tKbdMap *p = KbdMap; p->func != kfNone; p++) { for (tKbdMap *p = KbdMap; p->func != kfNone; p++) {
if (p->func == Func) if (p->func == Func)
@ -273,7 +273,7 @@ uint64 cKbdRemote::MapFuncToCode(int Func)
return (Func <= 0xFF) ? Func : 0; return (Func <= 0xFF) ? Func : 0;
} }
int cKbdRemote::MapCodeToFunc(uint64 Code) int cKbdRemote::MapCodeToFunc(uint64_t Code)
{ {
for (tKbdMap *p = KbdMap; p->func != kfNone; p++) { for (tKbdMap *p = KbdMap; p->func != kfNone; p++) {
if (p->code == Code) if (p->code == Code)
@ -296,9 +296,9 @@ int cKbdRemote::ReadKey(void)
return -1; return -1;
} }
uint64 cKbdRemote::ReadKeySequence(void) uint64_t cKbdRemote::ReadKeySequence(void)
{ {
uint64 k = 0; uint64_t k = 0;
int key1; int key1;
if ((key1 = ReadKey()) >= 0) { if ((key1 = ReadKey()) >= 0) {
@ -342,7 +342,7 @@ uint64 cKbdRemote::ReadKeySequence(void)
void cKbdRemote::Action(void) void cKbdRemote::Action(void)
{ {
while (Running()) { while (Running()) {
uint64 Command = ReadKeySequence(); uint64_t Command = ReadKeySequence();
if (Command) { if (Command) {
if (rawMode || !Put(Command)) { if (rawMode || !Put(Command)) {
int func = MapCodeToFunc(Command); int func = MapCodeToFunc(Command);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: remote.h 1.37 2006/10/14 11:46:58 kls Exp $ * $Id: remote.h 1.38 2006/12/02 11:12:49 kls Exp $
*/ */
#ifndef __REMOTE_H #ifndef __REMOTE_H
@ -35,7 +35,7 @@ protected:
cRemote(const char *Name); cRemote(const char *Name);
const char *GetSetup(void); const char *GetSetup(void);
void PutSetup(const char *Setup); void PutSetup(const char *Setup);
bool Put(uint64 Code, bool Repeat = false, bool Release = false); bool Put(uint64_t Code, bool Repeat = false, bool Release = false);
bool Put(const char *Code, bool Repeat = false, bool Release = false); bool Put(const char *Code, bool Repeat = false, bool Release = false);
public: public:
virtual ~cRemote(); virtual ~cRemote();
@ -100,13 +100,13 @@ private:
struct termios savedTm; struct termios savedTm;
virtual void Action(void); virtual void Action(void);
int ReadKey(void); int ReadKey(void);
uint64 ReadKeySequence(void); uint64_t ReadKeySequence(void);
int MapCodeToFunc(uint64 Code); int MapCodeToFunc(uint64_t Code);
public: public:
cKbdRemote(void); cKbdRemote(void);
virtual ~cKbdRemote(); virtual ~cKbdRemote();
static bool KbdAvailable(void) { return kbdAvailable; } static bool KbdAvailable(void) { return kbdAvailable; }
static uint64 MapFuncToCode(int Func); static uint64_t MapFuncToCode(int Func);
static void SetRawMode(bool RawMode); static void SetRawMode(bool RawMode);
}; };

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.c 1.120 2006/08/12 13:30:07 kls Exp $ * $Id: tools.c 1.121 2006/12/02 11:12:59 kls Exp $
*/ */
#include "tools.h" #include "tools.h"
@ -547,11 +547,11 @@ cTimeMs::cTimeMs(void)
Set(); Set();
} }
uint64 cTimeMs::Now(void) uint64_t cTimeMs::Now(void)
{ {
struct timeval t; struct timeval t;
if (gettimeofday(&t, NULL) == 0) if (gettimeofday(&t, NULL) == 0)
return (uint64(t.tv_sec)) * 1000 + t.tv_usec / 1000; return (uint64_t(t.tv_sec)) * 1000 + t.tv_usec / 1000;
return 0; return 0;
} }
@ -565,7 +565,7 @@ bool cTimeMs::TimedOut(void)
return Now() >= begin; return Now() >= begin;
} }
uint64 cTimeMs::Elapsed(void) uint64_t cTimeMs::Elapsed(void)
{ {
return Now() - begin; return Now() - begin;
} }

10
tools.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.h 1.93 2006/04/16 10:40:45 kls Exp $ * $Id: tools.h 1.94 2006/12/02 11:14:14 kls Exp $
*/ */
#ifndef __TOOLS_H #ifndef __TOOLS_H
@ -15,6 +15,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <poll.h> #include <poll.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <syslog.h> #include <syslog.h>
@ -22,7 +23,6 @@
#include <sys/types.h> #include <sys/types.h>
typedef unsigned char uchar; typedef unsigned char uchar;
typedef unsigned long long int uint64;
extern int SysLogLevel; extern int SysLogLevel;
@ -159,13 +159,13 @@ public:
class cTimeMs { class cTimeMs {
private: private:
uint64 begin; uint64_t begin;
public: public:
cTimeMs(void); cTimeMs(void);
static uint64 Now(void); static uint64_t Now(void);
void Set(int Ms = 0); void Set(int Ms = 0);
bool TimedOut(void); bool TimedOut(void);
uint64 Elapsed(void); uint64_t Elapsed(void);
}; };
class cReadLine { class cReadLine {