On 04/11/2011 08:01 PM, Eli Zaretskii wrote:
> When Emacs saves a buffer or some its portion,
> write-region can call emacs_write (though a_write and e_write) with
> the full extent of the region to be saved.
Ah, sorry, I missed that one. In that case 'int'
clearly won't do for the size.
> The issue here is that emacs_write and emacs_read are on the boundary:
> they accept Emacs Lisp integers, but then call a system API.
No, they are regularly passed size_t values as sizes,
in other sections of the code. I just now counted,
and the 16 calls to emacs_write use int constants
6 times, size_t 5 times, EMACS_INT 3 times, and an
int variable once. So, judging by the caller's usages,
size_t would seem more appropriate.
Furthermore, the API for emacs_write should be designed
to let callers know what emacs_write should do. Since emacs_write
operates on size values that fit into size_t, that would
seem to be the more appropriate type for its size argument.