summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave <vdr@pickles.me.uk>2012-05-23 20:07:45 +0100
committerDave <vdr@pickles.me.uk>2012-05-23 20:07:45 +0100
commit3cdc78d82574731f604573686c3945a80aa68c9d (patch)
tree3329b0820a595ac985c40aef8780642277b96d04
parentb0f3e30818ccb382c6827abe798dda63562fc6fe (diff)
downloadvdrtva-3cdc78d82574731f604573686c3945a80aa68c9d.tar.gz
vdrtva-3cdc78d82574731f604573686c3945a80aa68c9d.tar.bz2
Variables holding timestamps should be of type time_t.
-rw-r--r--TODO1
-rw-r--r--vdrtva.c14
-rw-r--r--vdrtva.h10
3 files changed, 13 insertions, 12 deletions
diff --git a/TODO b/TODO
index 9e15644..16b16d0 100644
--- a/TODO
+++ b/TODO
@@ -16,3 +16,4 @@ OSD for managing series links (work in progress).
Bugs:
Very rare crash 'pure virtual method called' in plugin - possibly solved.
+ Spurious timer clash report - seen once, cause unknown.
diff --git a/vdrtva.c b/vdrtva.c
index 910085f..a9470db 100644
--- a/vdrtva.c
+++ b/vdrtva.c
@@ -42,7 +42,7 @@ private:
cTvaFilter *Filter;
cTvaStatusMonitor *statusMonitor;
bool AppendItems(const char* Option);
- bool AddSeriesLink(const char *scrid, int modtime, const char *icrid, const char *path, const char *title);
+ bool AddSeriesLink(const char *scrid, time_t modtime, const char *icrid, const char *path, const char *title);
void LoadLinksFile(void);
bool SaveLinksFile(void);
bool UpdateLinksFromTimers(void);
@@ -531,7 +531,7 @@ void cPluginvdrTva::Report()
// add a new event to the Links table, either as an addition to an existing series or as a new series.
// return false = nothing done, true = new event for old series, or new series.
-bool cPluginvdrTva::AddSeriesLink(const char *scrid, int modtime, const char *icrid, const char *path, const char *title)
+bool cPluginvdrTva::AddSeriesLink(const char *scrid, time_t modtime, const char *icrid, const char *path, const char *title)
{
if (Links && (Links->MaxNumber() >=1)) {
for (cLinkItem *Item = Links->First(); Item; Item = Links->Next(Item)) {
@@ -562,7 +562,7 @@ void cPluginvdrTva::LoadLinksFile()
char *s;
char *strtok_next;
cReadLine ReadLine;
- int modtime;
+ time_t modtime;
while ((s = ReadLine.Read(f)) != NULL) {
char *scrid = strtok_r(s, ",", &strtok_next);
char *mtime = strtok_r(NULL, ";", &strtok_next);
@@ -587,7 +587,7 @@ bool cPluginvdrTva::SaveLinksFile()
FILE *f = fopen(newlinks, "w");
if (f) {
for (cLinkItem *Item = Links->First(); Item; Item = Links->Next(Item)) {
- fprintf(f, "%s,%d;%s", Item->sCRID(), Item->ModTime(), Item->iCRIDs());
+ fprintf(f, "%s,%ld;%s", Item->sCRID(), Item->ModTime(), Item->iCRIDs());
if (Item->Path()) {
fprintf(f, ";%s", Item->Path());
}
@@ -1436,7 +1436,7 @@ void cSuggestCRIDs::Expire(void) {
cLinkItem - Entry from the links file
*/
-cLinkItem::cLinkItem(const char *sCRID, int ModTime, const char *iCRIDs, const char *Path, const char *Title)
+cLinkItem::cLinkItem(const char *sCRID, time_t ModTime, const char *iCRIDs, const char *Path, const char *Title)
{
sCrid = strcpyrealloc(NULL, sCRID);
modtime = ModTime;
@@ -1453,7 +1453,7 @@ cLinkItem::~cLinkItem(void)
free(title);
}
-void cLinkItem::SetModtime(int ModTime)
+void cLinkItem::SetModtime(time_t ModTime)
{
modtime = ModTime;
}
@@ -1472,7 +1472,7 @@ cLinks::cLinks(void)
maxNumber = 0;
}
-cLinkItem *cLinks::NewLinkItem(const char *sCRID, int ModTime, const char *iCRIDs, const char *path, const char *title)
+cLinkItem *cLinks::NewLinkItem(const char *sCRID, time_t ModTime, const char *iCRIDs, const char *path, const char *title)
{
cLinkItem *NewLinkItem = new cLinkItem(sCRID, ModTime, iCRIDs, path, title);
Add(NewLinkItem);
diff --git a/vdrtva.h b/vdrtva.h
index 87f4ac8..2c28073 100644
--- a/vdrtva.h
+++ b/vdrtva.h
@@ -164,18 +164,18 @@ class cSuggestCRIDs : public cRwLock, public cConfig<cSuggestCRID> {
class cLinkItem : public cListObject {
private:
char *sCrid;
- int modtime;
+ time_t modtime;
char *iCrids;
char *path;
char *title;
public:
- cLinkItem(const char *sCRID, int ModTime, const char *iCRIDs, const char *Path, const char *Title);
+ cLinkItem(const char *sCRID, time_t ModTime, const char *iCRIDs, const char *Path, const char *Title);
~cLinkItem(void);
- void SetModtime(int modtime);
+ void SetModtime(time_t modtime);
void SetIcrids(const char *icrids);
char * iCRIDs(void) { return iCrids; }
char * sCRID(void) { return sCrid; }
- int ModTime(void) { return modtime; }
+ time_t ModTime(void) { return modtime; }
char * Path(void) { return path; }
char * Title(void) { return title; }
};
@@ -186,7 +186,7 @@ class cLinks : public cRwLock, public cConfig<cLinkItem> {
public:
cLinks(void);
int MaxNumber(void) { return maxNumber; }
- cLinkItem *NewLinkItem(const char *sCRID, int ModTime, const char *iCRIDs, const char *Path, const char *Title);
+ cLinkItem *NewLinkItem(const char *sCRID, time_t ModTime, const char *iCRIDs, const char *Path, const char *Title);
bool DeleteItem(const char *sCRID);
bool Expire(void);
};