@@ -40,7 +40,7 @@ class CholmodCtx {
40
40
};
41
41
static CholmodCtx cctx;
42
42
43
- #define BARF (args ... ) std::fprintf(stderr, ##args )
43
+ #define BARF (...) std::fprintf(stderr, __VA_ARGS__ )
44
44
45
45
// forward declarations for functions borrowed from mrcal-pywrap
46
46
static mrcal_problem_selections_t construct_problem_selections (
@@ -54,11 +54,10 @@ bool lensmodel_one_validate_args(mrcal_lensmodel_t *mrcal_lensmodel,
54
54
std::vector<double > intrinsics,
55
55
bool do_check_layout);
56
56
57
- // Empty vector just to pass in so it's not NULL?
58
- mrcal_point3_t observations_point[0 ];
59
- mrcal_pose_t
60
- extrinsics_rt_fromref[0 ]; // Always zero for single camera, it seems?
61
- mrcal_point3_t points[0 ]; // Seems to always to be None for single camera?
57
+ mrcal_point3_t * observations_point = nullptr ;
58
+ mrcal_pose_t *
59
+ extrinsics_rt_fromref = nullptr ; // Always zero for single camera, it seems?
60
+ mrcal_point3_t * points = nullptr ; // Seems to always to be None for single camera?
62
61
63
62
static std::unique_ptr<mrcal_result> mrcal_calibrate (
64
63
// List, depth is ordered array observation[N frames, object_height,
@@ -119,8 +118,10 @@ static std::unique_ptr<mrcal_result> mrcal_calibrate(
119
118
auto c_observations_board = observations_board_data.data ();
120
119
// Try to make sure we don't accidentally make a zero-length array or
121
120
// something stupid
122
- mrcal_observation_point_t
123
- c_observations_point[std::max (Nobservations_point, 1 )];
121
+ std::vector<mrcal_observation_point_t >
122
+ observations_point_data (std::max (Nobservations_point, 1 ));
123
+ mrcal_observation_point_t *
124
+ c_observations_point = observations_point_data.data ();
124
125
125
126
for (int i_observation = 0 ; i_observation < Nobservations_board;
126
127
i_observation++) {
0 commit comments