Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building unless WITH_ASSERT #9190

Closed
wants to merge 1 commit into from

Conversation

@BeWorld2018
Copy link

@BeWorld2018 BeWorld2018 commented May 4, 2021

Fix building unless WITH_ASSERT define

@LordAro
Copy link
Member

@LordAro LordAro commented May 4, 2021

I'm struggling to see what this solves. Can you please fill out the template and elaborate what problem you're solving? We already build with and without asserts...

@BeWorld2018
Copy link
Author

@BeWorld2018 BeWorld2018 commented May 4, 2021

For example, in tgp.cpp : you just missing last assert(found):

OpenTTD/src/tgp.cpp

Lines 657 to 678 in dd798d6

/* Apply all curve maps that are used on this tile. */
for (uint t = 0; t < lengthof(curve_maps); t++) {
if (!HasBit(corner_bits, t)) continue;
#ifdef WITH_ASSERT
bool found = false;
#endif
const control_point_t *cm = curve_maps[t].list;
for (uint i = 0; i < curve_maps[t].length - 1; i++) {
const control_point_t &p1 = cm[i];
const control_point_t &p2 = cm[i + 1];
if (*h >= p1.x && *h < p2.x) {
ht[t] = p1.y + (*h - p1.x) * (p2.y - p1.y) / (p2.x - p1.x);
#ifdef WITH_ASSERT
found = true;
#endif
break;
}
}
assert(found);
}

Context for me : i build OpenTTD on MorphOS system (PPC) and i use my own makefile and i dont use -DNDEBUG and -DWITH_ASSERT .. so here a problem.

Thanks

@LordAro
Copy link
Member

@LordAro LordAro commented May 4, 2021

Yeah... we do not support that. Why on Earth do you maintain your own makefile? As far as I can tell, cmake exists for MorphOS

@BeWorld2018
Copy link
Author

@BeWorld2018 BeWorld2018 commented May 4, 2021

Yeah... we do not support that. Why on Earth do you maintain your own makefile? As far as I can tell, cmake exists for MorphOS

because cmake is not ideal on MorphOS... i dont use it (not last version.. missing a lot of things...).

ok i close issue and use DNDEBUG.
Thanks

@BeWorld2018 BeWorld2018 closed this May 4, 2021
@LordAro
Copy link
Member

@LordAro LordAro commented May 4, 2021

If it helps, we don't require the "newest" version of cmake - only 3.9+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants