@rdipardo commented on this pull request.
- static gchar char_at(ScintillaObject *sci, gint pos)
+/* + +----------------------------------------------------------------------------- */ +{ + return sci_get_char_at(sci, pos); +}
Just curious: why the wrapper?
The [documented return type of `SCI_GETCHARAT`] is `int`, presumably for Unicode characters up to 32 bits in length. Squeezing that into an 8-bit(?) `(g)char` needs an explicit cast.
The (implied) point that just using the returned `(g)int` without a cast is worth considering. At the same time, the `pos` argument might be safer as the (platform independent) [`Sci_Position` type]. The API structures that can *only* index 32-bit positions are [slated for eventual deprecation].
[documented return type of `SCI_GETCHARAT`]: https://www.scintilla.org/ScintillaDoc.html#SCI_GETCHARAT [`Sci_Position` type]: https://github.com/geany/geany/blob/8a9e9be88545f83c91d378d6662790efa38959d4... [slated for eventual deprecation]: https://groups.google.com/g/scintilla-interest/c/mPLwYdC0-FE#:~:text=SCI_GET...)
github-comments@lists.geany.org