Commit graph

8245 commits

Author SHA1 Message Date
Kp 4324ed3771 Fix scanline casts when sizeof(size_t) is not sizeof(void*) 2016-06-05 01:04:26 +00:00
Kp ebebda5f17 Fix piggy casts when sizeof(size_t) is not sizeof(void*) 2016-06-05 01:04:26 +00:00
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
Kp badf0f4f90 Rewrite cast of (uint*) to standard type uint32_t
s/(\s*uint\s*\*\s*)/(uint32_t *)/g
2016-06-05 01:04:25 +00:00
Kp aeebffccc0 Rewrite cast of (ushort*) to standard type uint16_t
s/(\s*ushort\s*\*\s*)/(uint16_t *)/g
2016-06-05 01:04:25 +00:00
Kp b31446340c Rewrite cast of (ubyte*) to standard type uint8_t
s/(\s*ubyte\s*\*\s*)/(uint8_t *)/g
2016-06-05 01:04:25 +00:00
Kp 73b7905125 Fix -Wshadow warning in get_event (Windows only)
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
2016-06-01 01:52:45 +00:00
Kp 86b5427906 Fix -Wshadow warning in visited_segment_multibit_array_t::bitproxy_t
bitproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x.  Rename the parameter
to eliminate the warning.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
2016-06-01 01:52:45 +00:00
Kp eea74aefb7 Fix -Wshadow warning in visited_segment_multibit_array_t::tmpl_multibit_proxy_t
tmpl_multibit_proxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x.  Rename the parameter
to eliminate the warning.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
2016-06-01 01:52:45 +00:00
Kp 0cdc1dea72 Fix -Wshadow warning in visited_segment_mask_t::tmpl_maskproxy_t
tmpl_maskproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x.  Rename the parameter
to eliminate the warning.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
2016-06-01 01:52:45 +00:00
Kp 359f6f58ee Fix -Wshadow warning in visited_segment_bitarray_t::bitproxy_t
bitproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x.  Rename the parameter
to eliminate the warning.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
2016-06-01 01:52:45 +00:00
Kp aa4ad79fbe Fix -Wshadow warning in visited_segment_bitarray_t::tmpl_bitproxy_t
tmpl_bitproxy_t inherits a method named `shift` and its constructor took a
parameter named `shift`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x.  Rename the parameter
to eliminate the warning.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/200>
2016-06-01 01:52:45 +00:00
Kp a990bd9651 Describe git tag in banner output 2016-06-01 01:52:45 +00:00
Kp 0bba26fde5 Move ini.pop_back() into ReadIniArgs
Both callers of ReadIniArgs need the string removed afterward.  Prior to
8fb9a0f, only the parser for `-ini` needed the string removed.  The
caller for the automatic ini file ended and destroyed the container.  As
of 8fb9a0f, the container persists.  Leaving the string in the container
causes a bad error message if the command line is rejected.

It is bad form to have ReadIniArgs pop, but the caller push.  However,
the two callers use different signatures for emplace_back(), so unifying
the push would require calling a suboptimal emplace_back.  Choose the
lesser evil of unbalanced push/pop.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/198>
2016-05-31 00:42:56 +00:00
zico 660d18c312 Check for GM_MULTI together with Netgame.InvulAppear in init_player_stats_new_ship(). Otherwise going into Singleplayer after starting a Multiplayer match with this option set can translate this effect into Singleplayer. 2016-05-30 15:00:07 +02:00
zico e335cdacb3 Reverted 81d7db279b and rather removed the terminator byte from string length in nm_set_item_input(). This also fixes possible 9 character length for pilot callsigns. Had to fix up COOL_SAYING_LEN as it was not considering the termintor but considering the original D2 source, this was a mess to begin with (def = 50, text string = 60, input field len = 45). Made score saying 50 characters as this seems to be the maximum witdth without overlapping. 2016-05-30 14:54:51 +02:00
zico 1856e73ca6 Addition to 3366658a5bd2b30a82949b8b301e97b324ce539d: Changed show_netgame_info and pass netgame as reference and const; removed struct and extern; declared ngii inside show_netgame_info(). 2016-05-30 13:49:06 +02:00
zico a8ed0aaa9c Added breaks in event.cpp to prevent unwanted events if -nomouse and/or -nojoystick is given; Added automap_apply_input() to prevent multiple inputs per frame causing multiple movement applications. 2016-05-30 13:17:42 +02:00
Kp 487547050b Fix -Wshadow warning in visited_segment_mask_t::base_maskproxy_t
base_maskproxy_t has a method named `shift` and its constructor took a
parameter named `shift`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow in gcc before 5.x.  Rename the parameter
to eliminate the warning.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/197>
2016-05-29 17:46:32 +00:00
Kp 604778248d Fix -Wshadow warning in get_chunks_state
get_chunks_state has a member named `data` and its constructor took a
parameter named `data`.  This is unambiguous in the language, but causes
a warning from gcc's -Wshadow when building with WORDS_NEED_ALIGNMENT.
Rename the parameter to eliminate the warning.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/pull/196>
2016-05-29 17:46:32 +00:00
Kp 20163c49bc Fold gr_remap_bitmap_good call in D2 ab_load 2016-05-28 17:31:27 +00:00
Kp 0d189f3656 Fold gr_remap_bitmap_good call in D1 ab_load 2016-05-28 17:31:27 +00:00
Kp f073e9e377 Fold nm_messagebox call in net_udp_do_join_game 2016-05-28 17:31:27 +00:00
Kp 82a8f6ebb0 Pass bm_mode to gr_init_bitmap 2016-05-28 17:31:27 +00:00
Kp 3c5add9d0e Pass bm_mode to gr_init_bitmap_alloc 2016-05-28 17:31:27 +00:00
Kp 86122120b7 Pass bm_mode to gr_init_canvas 2016-05-28 17:31:27 +00:00
Kp dcc56e6b39 Propagate bm_mode::linear into iff_read_bitmap 2016-05-28 17:31:27 +00:00
Kp c00f918a8e Propagate bm_mode::linear into bald_guy_load 2016-05-28 17:31:26 +00:00
Kp 3fb16c1d7a Propagate bm_mode::linear into pcx_read_bitmap 2016-05-28 17:31:26 +00:00
Kp 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp a0cc2bfc7e Pass canvas to ogl_upixelc 2016-05-28 17:31:26 +00:00
Kp 0253907a88 Factor out ogl_upixelc palette lookups 2016-05-28 17:31:26 +00:00
Kp 2dfd87f276 Move OGL_VIEWPORT assignments above glViewport 2016-05-28 17:31:26 +00:00
Kp 4a3abb3ca3 Cache src values in gr_ubitmap00 2016-05-28 17:31:26 +00:00
Kp bbda32f78d Make cv_fade_level unsigned 2016-05-28 17:31:26 +00:00
Kp de219e3d48 Enable -Wshadow
All shadow warnings in the default build have been fixed.  Enable
-Wshadow by default to flag any new instances.
2016-05-22 17:50:13 +00:00
Kp 7d468491a1 Fix -Wshadow warnings in mission.cpp 2016-05-22 17:49:32 +00:00
Kp e3eceb2c6e Fix -Wshadow warnings in load_mission 2016-05-22 17:49:31 +00:00
Kp 9f76e9e97a Fix -Wshadow warnings in init_boss_segments 2016-05-22 17:49:31 +00:00
Kp ed330960f5 Fix -Wshadow warnings in _g3_draw_poly 2016-05-22 17:49:31 +00:00
Kp 48431682ba Fix -Wshadow warnings in gamedata_read_tbl 2016-05-22 17:49:31 +00:00
Kp f9f7ce08db Fix -Wshadow warnings in bm_read_sound 2016-05-22 17:49:31 +00:00
Kp 7c6765b8e5 Fix -Wshadow warnings in ab_load 2016-05-22 17:49:31 +00:00
Kp 2635d64e4b Fix -Wshadow warnings in gamedata_read_tbl 2016-05-22 17:49:31 +00:00
Kp 4d54e575ab Fix -Wshadow warnings in bm_read_sound 2016-05-22 17:49:31 +00:00
Kp 692bede8c3 Fix -Wshadow warnings in gr_toggle_fullscreen 2016-05-22 17:49:31 +00:00
Kp f98c47047a Fix -Wshadow warnings in med_rotate_group 2016-05-22 17:49:31 +00:00
Kp 523b7f036b Fix -Wshadow warnings in med_create_segment 2016-05-22 17:49:30 +00:00
Kp 688b376a90 Fix -Wshadow warnings in write_wall_text 2016-05-22 17:49:30 +00:00
Kp 0cae71b8a6 Fix -Wshadow warnings in draw_model 2016-05-22 17:49:30 +00:00