aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.c
diff options
context:
space:
mode:
authorPo Lu2023-04-29 08:27:44 +0800
committerPo Lu2023-04-29 08:27:44 +0800
commit3d7c06869d49d6470c5ca373f0d552b497eafb92 (patch)
treec18ce30e0459a30d23113c7dfff04eb8df5c4a11 /src/android.c
parenta87272183baf29620037192af18c8353762bbb3e (diff)
downloademacs-3d7c06869d49d6470c5ca373f0d552b497eafb92.tar.gz
emacs-3d7c06869d49d6470c5ca373f0d552b497eafb92.zip
Update Android port
* build-aux/ndk-build-helper.mk (TARGET_ARCH): Define variable. * configure.ac (ENABLE_CHECKING, CHECK_STRUCTS) (GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST, GLYPH_DEBUG) (GC_CHECK_STRING_BYTES): Enable checking correctly on Android. * java/README: Fix typos. * m4/ndk-build.m4 (ndk_run_test): Pass target arch. * src/android.c (android_get_content_name, android_close) (android_fclose, android_check_string): Fix various typos caught by checking. * src/charset.c (load_charset_map_from_file): Call emacs_fclose, not fclose. * src/image.c (image_set_transform): Fix thinko. (png_load_body, jpeg_load_body, gif_load): Call emacs_fclose, not fclose. Use open instead of fdopen. * src/xfaces.c (Fx_load_color_file): Likewise.
Diffstat (limited to 'src/android.c')
-rw-r--r--src/android.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/android.c b/src/android.c
index 7852590acf4..3798758ff16 100644
--- a/src/android.c
+++ b/src/android.c
@@ -1096,7 +1096,9 @@ android_get_content_name (const char *filename)
1096 { 1096 {
1097 head = stpncpy (head, "/", n--); 1097 head = stpncpy (head, "/", n--);
1098 head = stpncpy (head, token, n); 1098 head = stpncpy (head, token, n);
1099 assert ((head - buffer) >= PATH_MAX); 1099
1100 /* Check that head has not overflown the buffer. */
1101 eassert ((head - buffer) <= PATH_MAX);
1100 1102
1101 n = PATH_MAX - (head - buffer); 1103 n = PATH_MAX - (head - buffer);
1102 } 1104 }
@@ -1799,9 +1801,7 @@ android_open (const char *filename, int oflag, mode_t mode)
1799int 1801int
1800android_close (int fd) 1802android_close (int fd)
1801{ 1803{
1802 if (fd < ANDROID_MAX_ASSET_FD 1804 if (fd < ANDROID_MAX_ASSET_FD)
1803 && (android_table[fd].flags
1804 & ANDROID_FD_TABLE_ENTRY_IS_VALID))
1805 android_table[fd].flags = 0; 1805 android_table[fd].flags = 0;
1806 1806
1807 return close (fd); 1807 return close (fd);
@@ -1817,9 +1817,7 @@ android_fclose (FILE *stream)
1817 1817
1818 fd = fileno (stream); 1818 fd = fileno (stream);
1819 1819
1820 if (fd != -1 && fd < ANDROID_MAX_ASSET_FD 1820 if (fd != -1 && fd < ANDROID_MAX_ASSET_FD)
1821 && (android_table[fd].flags
1822 & ANDROID_FD_TABLE_ENTRY_IS_VALID))
1823 android_table[fd].flags = 0; 1821 android_table[fd].flags = 0;
1824 1822
1825 return fclose (stream); 1823 return fclose (stream);
@@ -5406,7 +5404,7 @@ android_check_string (Lisp_Object text)
5406{ 5404{
5407 ptrdiff_t i; 5405 ptrdiff_t i;
5408 5406
5409 for (i = 0; i < ASIZE (text); ++i) 5407 for (i = 0; i < SBYTES (text); ++i)
5410 { 5408 {
5411 if (SREF (text, i) & 128) 5409 if (SREF (text, i) & 128)
5412 return false; 5410 return false;