Opened 16 years ago
Closed 16 years ago
#4271 closed patch (fixed)
Legacy, implicit casts etc
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
The attached patch fixes some issues that cropped up during porting to MinGW: bzero has been declared as "legacy": replace with memset. Result of dlopen/dlsym is compared to NULL, instead of relying on dlopen(). others are related to using intrinsic datatypes, variable names reserved as type names, implicit casts that don't always work (e.g. pthread_t is not necessarily a pointer on all platforms).
Attachments (1)
Change History (7)
Changed 16 years ago by
Attachment: | legacy.patch added |
---|
comment:1 Changed 16 years ago by
Owner: | changed from Isaac Richards to danielk |
---|---|
Priority: | major → minor |
Severity: | medium → low |
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 16 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
globalsettings.cpp: grp1 is used as a standard resource ID when windows.h is included, instead of #undef'ing it I just renamed the local variable.
dvdnav: uint is not defined in MinGW, I didn't want to litter the files with #ifdef's and #define's, replaced with uint32_t
I can find a different workaround for both issues, but I would prefer to do it this way.
comment:5 Changed 16 years ago by
The globalsettings.cpp variable rename is fine, I just thought it was chaff because I didn't know about the windows.h define.
For uint, I can add it to compat.h, there was already such a typedef in my own compat.h, but I didn't think it was needed for MythTV because <types.h> has uint.
Minimizing #ifdef's is an important goal.
Please look at libavformat/utils.c parse_date, using the non-threadsafe version of gmtime_r() and localtime_r is not acceptable. But you can create emulation wrappers for MS Windows and stick them in a "compat.h" header.
There was no apparent need for the programs/mythfrontend/globalsettings.cpp, or dvdnav changes so I dropped them.
dlfcn.h is needed on real POSIX systems in filtermanager.cpp, if it doesn't exist on MS Windows, it should be protected with an #ifdef
-- I'll commit the other changes as soon as I've finished some testing.