Change hardcoded beta warning to macro?

Started by Marsu42, September 20, 2012, 10:20:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marsu42

I'm usually changing a line in menu.c to beta_warned=1 because I know I compiled it myself :-p

But maybe it'd be convenient to include a generic option that is switchable through Makefile.user. The other option would be to wrap all the beta code in a macro, reducing the build size a bit for release builds.. just an idea.

EDIT: Here's the patch, just add -DCONFIG_RELEASE_BUILD to CFLAG_USER ...

# HG changeset patch
# User Marsu42
# Date 1348137927 -7200
# Branch unified
# Node ID ae35f7a27e6e1358606a7e5afe49c909e707c7de
# Parent  00110a6f83aa7c05bb19f46c71c456f29ffedd13
Option to skip beta warning & some optimization CFLAGS (disabled by default)

diff -r 00110a6f83aa -r ae35f7a27e6e Makefile.user.default
--- a/Makefile.user.default Thu Sep 20 10:38:31 2012 +0300
+++ b/Makefile.user.default Thu Sep 20 12:45:27 2012 +0200
@@ -19,7 +19,7 @@
PYTHON=python2

# You can customize CFLAG here
-#CFLAG_USER = -mlong-calls \
+#CFLAG_USER = -march=armv5te -mcpu=arm946e-s -O2 -DCONFIG_RELEASE_BUILD \

# Naming convention for Magic Lantern builds:
# General rules:
diff -r 00110a6f83aa -r ae35f7a27e6e src/menu.c
--- a/src/menu.c Thu Sep 20 10:38:31 2012 +0300
+++ b/src/menu.c Thu Sep 20 12:45:27 2012 +0200
@@ -155,7 +155,12 @@
*/
}

+#ifdef CONFIG_RELEASE_BUILD
+int beta_warned = 1;
+#else
int beta_warned = 0;
+#endif
+
void
draw_beta_warning()
{

miyake

+1 !!
Make patch file or make pull request to your repo.

Marsu42

Quote from: miyake on September 20, 2012, 11:22:13 AM
Make patch file or make pull request to your repo.

I added a patch file above - I'm not very accustomed to Mercurial/git and other distributed thingies yet, imho it was a mistake men ever came down from trees and stopped using cvs :->

miyake

I think you need to add y/n style in Makefile.in and Makefile.user.default.
Or specify DCONFIG_RELEASE_BUILD  in Makefile.user.default by comment.
It's better for humans. we are forget a lot of things soon.

If you complete the patch, you make a PM to Alex or nanomad, I think they will merge it.

I also used CVS before development ML. Now my local repo is mercurial . But I don't know how to make a pull request system on my own system now...

Marsu42


miyake


miyake