Commit graph

84 commits

Author SHA1 Message Date
Kp 7af34fa844 Fold create_n_segment_path calls 2016-07-09 17:58:35 +00:00
Kp b282bea173 Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
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 79edcd0c17 Pass object &to player_path_set_orient_and_vel 2016-04-23 17:59:47 +00:00
Kp bce267f82f Pass object_base &to ai_turn_randomly 2016-04-09 21:40:27 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp 1f9e69b0b7 Replace highest_valid(V,offset) with partial_range 2016-02-06 22:12:55 +00:00
Kp cefc79f869 Construct find_point_seg segptridx explicitly 2016-01-09 16:38:13 +00:00
Kp 5ba5910e7a Use symbolic side_none for testing find_connect_side result 2016-01-03 20:21:35 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp ed55763603 Remove unused symbols 2015-12-04 03:36:31 +00:00
Kp dad504cfef Fix some -Wshadow warnings 2015-11-26 02:56:54 +00:00
Kp 8f656c40db Use range_for for validate_path 2015-10-13 02:43:24 +00:00
Kp 84bd64a14c Remove default argument for basic_ptridx(magic,array) 2015-07-29 03:05:28 +00:00
Kp fa8dcc9113 Explicitly delete basic_ptridx(pointer_type); require array
Require the array argument for basic_ptridx, which is supplied
automatically when the factory is used.
2015-07-13 01:09:37 +00:00
Kp 73fdd59225 Require exact type for valptridx factory 2015-07-13 01:09:36 +00:00
Kp 05fe25b3d4 Use valptr for aipath.cpp 2015-07-12 01:04:19 +00:00
Kp fdd2356eac Use segptridx for Cursegp, Markedsegp 2015-07-12 01:04:18 +00:00
Kp cda5cb160c Use valptr for aipath highest_valid 2015-06-13 22:42:16 +00:00
Kp 4007b297ec Pass vcsegptr to aipath compute_segment_center 2015-05-28 03:08:39 +00:00
Kp f15ec9c86a Use enum for AIM constants 2015-04-26 20:15:51 +00:00
Kp 150e2d2686 Convert local arrays to array<> 2015-04-19 04:18:49 +00:00
Kp 5ae5033fed Use enum for AIB constants 2015-04-02 02:36:57 +00:00
Kp 9157e5f970 Use enum class for player_awareness_type_t 2015-04-02 02:36:53 +00:00
Kp 7840885473 Fix clang -Wparentheses-equality warnings 2015-03-22 18:49:21 +00:00
Kp 2c09f9fa90 Propagate special types for distance/magnitude 2015-03-12 02:21:19 +00:00
Kp 223f11bb70 Return count from insert_center_points 2015-02-14 22:48:28 +00:00
Kp c6bb4206e6 Use array<> for create_random_xlate 2015-02-14 22:48:28 +00:00
Kp 078d9513e0 Pass end-of-list for ignore_obj_list 2015-02-05 03:03:51 +00:00
Kp 99a4a0ed62 Capture range_for by-value temporaries as const
Modifying a by-value temporary does not affect the underlying container,
so modifying it is almost always a bug.  Require use of a by-reference
capture when modification is desired.

sed -i -e 's/range_for\s*(\s*\(const\s\+\)\?auto\s\+\([[:alpha:]_]\)/range_for (const auto \2/g'
2015-02-05 03:03:49 +00:00
Kp 4a2c9325bb Fix various uninitialized accesses 2015-01-28 03:42:52 +00:00
Kp c8b5fe5552 Pass find_vector_intersection arg by & 2015-01-20 02:46:42 +00:00
Kp 84e3a03451 Remove unused parameters 2015-01-18 01:58:33 +00:00
Kp fbac119095 Propagate use of objptridx_t 2014-12-23 04:20:27 +00:00
Kp 2c349136cc Avoid slicing into segnum_t local 2014-11-20 03:00:36 +00:00
Kp d76e259db5 Add vm_vec_cross that returns result 2014-11-02 03:44:12 +00:00
Kp 40eb2e6b01 Add vm_vec_scale_add that returns result 2014-11-02 03:43:57 +00:00
Kp c78b3e61af Pass player_path_set_orient_and_vel vector by & 2014-11-02 03:41:39 +00:00
Kp a0c8536075 Pass ai_path_set_orient_and_vel vector by & 2014-11-02 03:41:21 +00:00
Kp 6d61198130 Pass compute_segment_center vector by & 2014-10-30 03:32:51 +00:00
Kp 8a89eff0bb Pass compute_center_point_on_side vector by & 2014-10-30 03:32:27 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp a32547af16 Pass position-related vms_vector arg by & 2014-10-22 02:46:03 +00:00
Kp 7f648c0f5f Wrap segment iteration idiom 2014-10-12 23:10:05 +00:00
Kp fb641b3250 Wrap object iteration idiom 2014-10-12 23:05:46 +00:00
Kp 5b97433ce5 Make various ai functions take const vms_vector& 2014-10-02 03:02:36 +00:00
Kp 16b87b350f Pass const vms_vector* to ai_follow_path 2014-10-02 03:02:36 +00:00
Kp a99466f8c8 Pass vm_vec_crossprod arg by & 2014-10-01 02:28:42 +00:00