Mir

Code review comment for lp:~mir-team/mir/size-t-display-config-api

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Hmm, by that definition a number or index of structures may use size_t. Just not a number of millimetres.

(1) So in the least size_t needs to be removed from:

    mir_output_get_physical_height_mm
    mir_output_get_physical_width_mm

(2) Also this is not portable since some platforms won't have sizeof(unsigned long) == sizeof(size_t):

219 - int output_id;
220 - if (++action < action_end && 1 == sscanf(*action, "%d", &output_id))
221 + size_t output_id;
222 + if (++action < action_end && 1 == sscanf(*action, "%lu", &output_id))

(3) To avoid forcing downstreams to cast, it would be helpful to make this int or ssize_t:

   current_mode_index
   preferred_mode_index

because they are allowed to be and often are negative.

review: Needs Fixing

« Back to merge proposal