Skip to content

Fixing up some issues left over from windows build, and a pass at compiler warnings cleanup#291

Merged
braice merged 3 commits into
braice:mumudvb2from
trollcop:master
Apr 28, 2022
Merged

Fixing up some issues left over from windows build, and a pass at compiler warnings cleanup#291
braice merged 3 commits into
braice:mumudvb2from
trollcop:master

Conversation

@trollcop

Copy link
Copy Markdown
Contributor

This is slightly smaller than the last one :)

I've replaced MU_F_T/MU_F_V back to where they were before windows build patch - an extra ; was giving hell to msvc compiler but happily ignored by gcc.

Also replaced a bunch of malloc/strncpy patterns with strdup. Can't imagine any system made in the last 10+ years where strdup wasn't available, and it gets rid of a bunch of build warnings related to strncpy safety.

…r invocation under VisualStudio.

Original code had an extra ";" after the struct entry, which was ignored by GCC but flagged as error by Visual Studio.
Since MU_F_T/MU_F_V defintion already INCLUDES the ";", it must NOT be added when calling the macro.
Replaced a bunch of malloc/strncpy with strdup()
Missing include for gettimeofday() when compiling with CAM disabled
Comment thread src/mumudvb.h
char name[MAX_NAME_LEN];
mumu_f_t name_f; /* MU_F_T(name); */
MU_F_T(name)
char service_name[MAX_NAME_LEN];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original code had MU_F_T(name); which would end up as mumu_f_t name_f;; breaking the compiler

Comment thread src/mumudvb_common.c
tempchar=malloc(sizeof(char)*(len+1));
if (tempchar == NULL)
return 0;
strncpy(tempchar,string,len);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's gotta be a better pattern to do this either way.

Comment thread src/ts.c
switch(descr->polarization)
{
log_message( log_module, MSG_FLOOD, "Polarization: (0x%02x)", descr->polarization);
case 0:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is what you were trying to do, but either way it doens't belong inside switch()

Comment thread src/unicast_monit.c
#ifndef _WIN32
#include <sys/time.h>
#endif
#ifdef ENABLE_CAM_SUPPORT

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cam.h includes that, but when ENABLE_CAM_SUPPORT is off that header isn't included

@braice
braice merged commit f80fecd into braice:mumudvb2 Apr 28, 2022
trollcop added a commit to trollcop/MuMuDVB that referenced this pull request Apr 29, 2022
Merge pull request braice#291 from trollcop/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants