Ticket #12996: 0011-Fix-compiler-enumeral-and-non-enumeral-type-in-condi.patch

File 0011-Fix-compiler-enumeral-and-non-enumeral-type-in-condi.patch, 1.7 KB (added by David Hampton <mythtv@…>, 3 years ago)

Fix compiler 'enumeral and non-enumeral' warning in recordinginfo.cpp.

  • mythtv/libs/libmyth/recordingtypes.h

    Fix compiler 'enumeral and non-enumeral type in conditional
    expression' warning.
    
    Rewrite the ForgetHistory function to use a more explicit test of
    whether or not local variables have been set.
    ---
     mythtv/libs/libmyth/recordingtypes.h    | 2 ++
     mythtv/libs/libmythtv/recordinginfo.cpp | 9 +++++++--
     2 files changed, 9 insertions(+), 2 deletions(-)
    
    diff --git a/mythtv/libs/libmyth/recordingtypes.h b/mythtv/libs/libmyth/recordingtypes.h
    index 5f3166f..eca7f44 100644
    a b MPUBLIC int RecTypePrecedence(RecordingType rectype); 
    4141
    4242typedef enum RecordingDupInTypes
    4343{
     44    kDupsUnset          = 0x00,
    4445    kDupsInRecorded     = 0x01,
    4546    kDupsInOldRecorded  = 0x02,
    4647    kDupsInAll          = 0x0F,
    MPUBLIC RecordingDupInType dupInFromString(QString); 
    5354
    5455typedef enum RecordingDupMethodType
    5556{
     57    kDupCheckUnset    = 0x00,
    5658    kDupCheckNone     = 0x01,
    5759    kDupCheckSub      = 0x02,
    5860    kDupCheckDesc     = 0x04,
  • mythtv/libs/libmythtv/recordinginfo.cpp

    diff --git a/mythtv/libs/libmythtv/recordinginfo.cpp b/mythtv/libs/libmythtv/recordinginfo.cpp
    index 3a87da0..77cbac7 100644
    a b void RecordingInfo::DeleteHistory(void) 
    13431343void RecordingInfo::ForgetHistory(void)
    13441344{
    13451345    uint erecid = parentid ? parentid : recordid;
    1346     uint din = dupin ? dupin : kDupsInAll;
    1347     uint dmeth = dupmethod ? dupmethod : kDupCheckSubThenDesc;
     1346    uint din = dupin;
     1347    uint dmeth = dupmethod;
     1348
     1349    if (din == kDupsUnset)
     1350        din = kDupsInAll;
     1351    if (dmeth == kDupCheckUnset)
     1352        dmeth = kDupCheckSubThenDesc;
    13481353
    13491354    MSqlQuery result(MSqlQuery::InitCon());
    13501355