Ticket #5778: libs_libmythdb-krazy2-replace-define.patch

File libs_libmythdb-krazy2-replace-define.patch, 3.3 KB (added by Erik Hovland <erik@…>, 11 years ago)

Replaces #define values with const values in libmythdb

  • mythtv/libs/libmythdb/msocketdevice_win.cpp

    Replace #define of values with const types.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythtv/libs/libmythdb/msocketdevice_win.cpp |    8 +++----
     mythtv/libs/libmythdb/mythverbose.cpp       |    4 ++-
     mythtv/libs/libmythdb/qcodecs.cpp           |   32 ++++++++++++++-------------
     3 files changed, 22 insertions(+), 22 deletions(-)
    
    diff --git a/mythtv/libs/libmythdb/msocketdevice_win.cpp b/mythtv/libs/libmythdb/msocketdevice_win.cpp
    index 7a984d9..a986a8b 100644
    a b  
    6565#  endif
    6666#  endif
    6767// Use our own defines and structs which we know are correct
    68 #  define QT_SS_MAXSIZE 128
     68const unsigned int QT_SS_MAXSIZE = 128;
    6969#  define QT_SS_ALIGNSIZE (sizeof(__int64))
    7070#  define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short))
    7171#  define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE))
    struct qt_in6_addr { 
    8484    uchar qt_s6_addr[16];
    8585};
    8686typedef struct {
    87     short   sin6_family;            /* AF_INET6 */
     87    short   sin6_family;           /* AF_INET6 */
    8888    ushort sin6_port;              /* Transport level port number */
    8989    ulong  sin6_flowinfo;          /* IPv6 flow information */
    90     struct  qt_in6_addr sin6_addr;  /* IPv6 address */
     90    struct  qt_in6_addr sin6_addr; /* IPv6 address */
    9191    ulong  sin6_scope_id;          /* set of interfaces for a scope */
    9292} qt_sockaddr_in6;
    9393#endif
    9494
    9595#ifndef AF_INET6
    96 #define AF_INET6        23              /* Internetwork Version 6 */
     96const unsigned int AF_INET6 = 23;  /* Internetwork Version 6 */
    9797#endif
    9898
    9999#ifndef NO_ERRNO_H
  • mythtv/libs/libmythdb/mythverbose.cpp

    diff --git a/mythtv/libs/libmythdb/mythverbose.cpp b/mythtv/libs/libmythdb/mythverbose.cpp
    index 2cb6837..a168ace 100644
    a b  
    44
    55#include "mythverbose.h"
    66
    7 #define GENERIC_EXIT_OK                             0
    8 #define GENERIC_EXIT_INVALID_CMDLINE              252
     7const unsigned int GENERIC_EXIT_OK              = 0;
     8const unsigned int GENERIC_EXIT_INVALID_CMDLINE = 252;
    99
    1010QMutex verbose_mutex;
    1111unsigned int print_verbose_messages = VB_IMPORTANT | VB_GENERAL;
  • mythtv/libs/libmythdb/qcodecs.cpp

    diff --git a/mythtv/libs/libmythdb/qcodecs.cpp b/mythtv/libs/libmythdb/qcodecs.cpp
    index 8883954..46904c6 100644
    a b  
    4040
    4141#include "qcodecs.h"
    4242
    43 #define QMD5_S11 7
    44 #define QMD5_S12 12
    45 #define QMD5_S13 17
    46 #define QMD5_S14 22
    47 #define QMD5_S21 5
    48 #define QMD5_S22 9
    49 #define QMD5_S23 14
    50 #define QMD5_S24 20
    51 #define QMD5_S31 4
    52 #define QMD5_S32 11
    53 #define QMD5_S33 16
    54 #define QMD5_S34 23
    55 #define QMD5_S41 6
    56 #define QMD5_S42 10
    57 #define QMD5_S43 15
    58 #define QMD5_S44 21
     43const unsigned int QMD5_S11 = 7;
     44const unsigned int QMD5_S12 = 12;
     45const unsigned int QMD5_S13 = 17;
     46const unsigned int QMD5_S14 = 22;
     47const unsigned int QMD5_S21 = 5;
     48const unsigned int QMD5_S22 = 9;
     49const unsigned int QMD5_S23 = 14;
     50const unsigned int QMD5_S24 = 20;
     51const unsigned int QMD5_S31 = 4;
     52const unsigned int QMD5_S32 = 11;
     53const unsigned int QMD5_S33 = 16;
     54const unsigned int QMD5_S34 = 23;
     55const unsigned int QMD5_S41 = 6;
     56const unsigned int QMD5_S42 = 10;
     57const unsigned int QMD5_S43 = 15;
     58const unsigned int QMD5_S44 = 21;
    5959
    6060namespace QCodecs
    6161{