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

Day length patch #3157

Closed
DorpsGek opened this issue Aug 29, 2009 · 3 comments
Closed

Day length patch #3157

DorpsGek opened this issue Aug 29, 2009 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

pavel1269 opened the ticket and wrote:

Patch to adjust day length. Not first, I know, but I think (hope) that finaly completed.

For more info: http://www.tt-forums.net/viewtopic.php?f=33&t=42432

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3157
@DorpsGek
Copy link
Member Author

Alberth wrote:

Just a few code style comments and other things I noticed, I have no idea about how good or bad this patch is in other aspects.
I just pick random code fragments I encounter, most comments apply at many places in the code.

+ if( _settings_game.economy.day_length_balance_type == DBT_ALL_COSTS )
+ res.AffectCost( _settings_game.economy.day_length_balance_factor );
Coding style errors.
no space after if
an additional space inside the outer parentheses
statement after the if is not allowed in this way. either at the same line, or use curly brackets

+ if( (((_date_fract % DAY_TICKS) == 0) && ( !(_settings_game.economy.slow_down_industry_changes) )) ||
+ ( _date_fract == 0 ) )
+ {
+ IndustryDailyLoop();
+ }
Coding style errors.
no space after if
an additional space inside the outer parentheses
unneeded parentheses all over the place
open curly bracket at same line as the if, not below it

+* Returns a number of days in current month.
+*/
+static Day DaysInCurrentMonth()
Also document the returned value with @return

+* Return a day and tick, where new month on day length 1 would start.
+*/
+static void NewMonthAt( Day cur_day, DayTick *dt )
"return" ?
formal parameters must also be documented with @param

+# define DAYS_IN_YEAR 365 ///< days per year
+# define DAYS_IN_LEAP_YEAR 366 ///< sometimes, you need one day more...
don't change enums back to # define

+STR_CONFIG_PATCHES_DAY_LENGTH_FACTOR :{LTBLUE}Day length factor: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DAY_LENGTH_BALANCE :{LTBLUE}Balancing of day length: {ORANGE}{STRING}
nearby are CONFIG_SETTINGS which seems a better name than CONFIG_PATCHES to me

+ UpdateGraphPerformance();
in a list if InitializeXXXX calls. looks fishy. perhaps rename it?

+static bool UpdateAllCosts(int32 p1)
static functions must also be documented


This comment was imported from FlySpray: https://bugs.openttd.org/task/3157#comment6557

@DorpsGek
Copy link
Member Author

pavel1269 wrote:

Updated coding style.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3157#comment6559

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Mass closure of patch tickets with no commentary for >5 years. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets).


This comment was imported from FlySpray: https://bugs.openttd.org/task/3157

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant