"Dr. David Alan Gilbert" <dgilb...@redhat.com> wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> Peter Xu <pet...@redhat.com> wrote: >> > It was "int" and used as 32bits fields (see save_section_header()). >> > It's unsafe already because sizeof(int) could be 2 on i386, I think. >> > So at least uint32_t would suite more. While it also uses "-1" as a >> > placeholder of "we want to generate the instance ID automatically". >> > Hence a more proper value should be int64_t. >> > >> > This will start to be useful after next patch in which we can start to >> > convert a real uint32_t value as instance ID. >> > >> > Signed-off-by: Peter Xu <pet...@redhat.com> >> >> Hi >> >> Being more helpful, I think that it is better to just: >> >> * change instance_id to be an uint32_t (notice that for all architectures >> that we support, it is actually int32_t). >> >> * export calculate_new_instance_id() and adjust callers that use -1. >> >> or >> >> * export a new function that just use the calculate_new_instance_id() > > Do you mean that we end up with two functions, one that does it > automatically, and one that takes an ID?
That is one option. The other is that we export calculate_new_instance_id(), and we use that instead of -1. Later, Juan.