diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-05-22 10:51:03 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-05-22 10:51:03 +0200 |
commit | d7c07ecbfd1fe35784b809298db73ac26804085b (patch) | |
tree | 1d504cb6e2cdad3c264be410e3264101ba30f6de /diseqc.h | |
parent | 7978112850497d4a4587c142923c248747aed383 (diff) | |
download | vdr-d7c07ecbfd1fe35784b809298db73ac26804085b.tar.gz vdr-d7c07ecbfd1fe35784b809298db73ac26804085b.tar.bz2 |
Fixed a possible race condition in cDiseqc::Execute()
Diffstat (limited to 'diseqc.h')
-rw-r--r-- | diseqc.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: diseqc.h 2.1 2010/02/06 15:14:42 kls Exp $ + * $Id: diseqc.h 2.2 2011/05/22 10:35:38 kls Exp $ */ #ifndef __DISEQC_H @@ -33,15 +33,15 @@ private: int lof; char *commands; bool parsing; - uchar codes[MaxDiseqcCodes]; - int numCodes; - char *Wait(char *s); - char *Codes(char *s); + mutable uchar codes[MaxDiseqcCodes]; + mutable int numCodes; + const char *Wait(const char *s) const; + const char *Codes(const char *s) const; public: cDiseqc(void); ~cDiseqc(); bool Parse(const char *s); - eDiseqcActions Execute(char **CurrentAction); + eDiseqcActions Execute(const char **CurrentAction) const; // Parses the DiSEqC commands and returns the appropriate action code // with every call. CurrentAction must be the address of a character pointer, // which is initialized to NULL. This pointer is used internally while parsing @@ -55,12 +55,12 @@ public: char Polarization(void) const { return polarization; } int Lof(void) const { return lof; } const char *Commands(void) const { return commands; } - uchar *Codes(int &NumCodes) { NumCodes = numCodes; return numCodes ? codes : NULL; } + const uchar *Codes(int &NumCodes) const { NumCodes = numCodes; return numCodes ? codes : NULL; } }; class cDiseqcs : public cConfig<cDiseqc> { public: - cDiseqc *Get(int Device, int Source, int Frequency, char Polarization); + const cDiseqc *Get(int Device, int Source, int Frequency, char Polarization) const; }; extern cDiseqcs Diseqcs; |