Mercurial > hg > xemacs-beta
comparison src/redisplay.c @ 4970:5c89ceb69819
fix compile problems
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-04 Ben Wing <ben@xemacs.org>
* bytecode.c (assert_failed_with_remembered_ops):
* bytecode.c (init_opcode_table_multi_op):
Declare some things const to shut up G++ v4 warnings.
* redisplay.c (add_ibyte_string_runes):
* redisplay.c (add_string_to_fstring_db_runes):
* redisplay.c (generate_fstring_runes):
* redisplay.c (window_line_number):
* redisplay.c (decode_mode_spec):
Use Ascbyte instead of char in various places.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Thu, 04 Feb 2010 05:39:00 -0600 |
parents | 4d35e52790f8 |
children | 16112448d484 |
comparison
equal
deleted
inserted
replaced
4969:cbe181529c34 | 4970:5c89ceb69819 |
---|---|
1274 Bytecount len = end - pos; | 1274 Bytecount len = end - pos; |
1275 prop = Dynarr_new (prop_block); | 1275 prop = Dynarr_new (prop_block); |
1276 | 1276 |
1277 pb.type = PROP_STRING; | 1277 pb.type = PROP_STRING; |
1278 pb.data.p_string.str = xnew_array (Ibyte, len); | 1278 pb.data.p_string.str = xnew_array (Ibyte, len); |
1279 strncpy ((char *) pb.data.p_string.str, (char *) pos, len); | 1279 qxestrncpy (pb.data.p_string.str, pos, len); |
1280 pb.data.p_string.len = len; | 1280 pb.data.p_string.len = len; |
1281 | 1281 |
1282 Dynarr_add (prop, pb); | 1282 Dynarr_add (prop, pb); |
1283 return prop; | 1283 return prop; |
1284 } | 1284 } |
4017 data->blank_width = space_width (XWINDOW (data->window)); | 4017 data->blank_width = space_width (XWINDOW (data->window)); |
4018 while (Dynarr_length (db->runes) < pos) | 4018 while (Dynarr_length (db->runes) < pos) |
4019 add_blank_rune (data, NULL, 0); | 4019 add_blank_rune (data, NULL, 0); |
4020 | 4020 |
4021 end = (Dynarr_length (db->runes) + | 4021 end = (Dynarr_length (db->runes) + |
4022 bytecount_to_charcount (str, strlen ((const char *) str))); | 4022 bytecount_to_charcount (str, qxestrlen (str))); |
4023 if (max_pos != -1) | 4023 if (max_pos != -1) |
4024 end = min (max_pos, end); | 4024 end = min (max_pos, end); |
4025 | 4025 |
4026 while (pos < end && *cur_pos) | 4026 while (pos < end && *cur_pos) |
4027 { | 4027 { |
4452 } | 4452 } |
4453 else | 4453 else |
4454 { | 4454 { |
4455 invalid: | 4455 invalid: |
4456 { | 4456 { |
4457 const char *str = GETTEXT ("*invalid*"); | 4457 const Ascbyte *str = GETTEXT ("*invalid*"); |
4458 Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */ | 4458 Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */ |
4459 | 4459 |
4460 if (size <= *offset) | 4460 if (size <= *offset) |
4461 *offset -= size; | 4461 *offset -= size; |
4462 else | 4462 else |
7228 /* Efficiently determine the window line number, and return a pointer | 7228 /* Efficiently determine the window line number, and return a pointer |
7229 to its printed representation. Do this regardless of whether | 7229 to its printed representation. Do this regardless of whether |
7230 line-number-mode is on. The first line in the buffer is counted as | 7230 line-number-mode is on. The first line in the buffer is counted as |
7231 1. If narrowing is in effect, the lines are counted from the | 7231 1. If narrowing is in effect, the lines are counted from the |
7232 beginning of the visible portion of the buffer. */ | 7232 beginning of the visible portion of the buffer. */ |
7233 static char * | 7233 static Ascbyte * |
7234 window_line_number (struct window *w, int type) | 7234 window_line_number (struct window *w, int type) |
7235 { | 7235 { |
7236 struct device *d = XDEVICE (XFRAME (w->frame)->device); | 7236 struct device *d = XDEVICE (XFRAME (w->frame)->device); |
7237 struct buffer *b = XBUFFER (w->buffer); | 7237 struct buffer *b = XBUFFER (w->buffer); |
7238 /* Be careful in the order of these tests. The first clause will | 7238 /* Be careful in the order of these tests. The first clause will |
7248 EMACS_INT line; | 7248 EMACS_INT line; |
7249 | 7249 |
7250 line = buffer_line_number (b, pos, 1); | 7250 line = buffer_line_number (b, pos, 1); |
7251 | 7251 |
7252 { | 7252 { |
7253 static char window_line_number_buf[DECIMAL_PRINT_SIZE (long)]; | 7253 static Ascbyte window_line_number_buf[DECIMAL_PRINT_SIZE (long)]; |
7254 | 7254 |
7255 long_to_string (window_line_number_buf, line + 1); | 7255 long_to_string (window_line_number_buf, line + 1); |
7256 | 7256 |
7257 return window_line_number_buf; | 7257 return window_line_number_buf; |
7258 } | 7258 } |
7273 | 7273 |
7274 static void | 7274 static void |
7275 decode_mode_spec (struct window *w, Ichar spec, int type) | 7275 decode_mode_spec (struct window *w, Ichar spec, int type) |
7276 { | 7276 { |
7277 Lisp_Object obj = Qnil; | 7277 Lisp_Object obj = Qnil; |
7278 const char *str = NULL; | 7278 const Ascbyte *str = NULL; |
7279 struct buffer *b = XBUFFER (w->buffer); | 7279 struct buffer *b = XBUFFER (w->buffer); |
7280 | 7280 |
7281 Dynarr_reset (mode_spec_ibyte_string); | 7281 Dynarr_reset (mode_spec_ibyte_string); |
7282 | 7282 |
7283 switch (spec) | 7283 switch (spec) |
7297 { | 7297 { |
7298 Charbpos pt = (w == XWINDOW (Fselected_window (Qnil))) | 7298 Charbpos pt = (w == XWINDOW (Fselected_window (Qnil))) |
7299 ? BUF_PT (b) | 7299 ? BUF_PT (b) |
7300 : marker_position (w->pointm[type]); | 7300 : marker_position (w->pointm[type]); |
7301 int col = column_at_point (b, pt, 1) + !!column_number_start_at_one; | 7301 int col = column_at_point (b, pt, 1) + !!column_number_start_at_one; |
7302 char buf[DECIMAL_PRINT_SIZE (long)]; | 7302 Ascbyte buf[DECIMAL_PRINT_SIZE (long)]; |
7303 | 7303 |
7304 long_to_string (buf, col); | 7304 long_to_string (buf, col); |
7305 | 7305 |
7306 Dynarr_add_many (mode_spec_ibyte_string, | 7306 Dynarr_add_many (mode_spec_ibyte_string, |
7307 (const Ibyte *) buf, strlen (buf)); | 7307 (const Ibyte *) buf, strlen (buf)); |
7338 { | 7338 { |
7339 struct frame *f = XFRAME (w->frame); | 7339 struct frame *f = XFRAME (w->frame); |
7340 if (FRAME_TTY_P (f) && f->order_count > 1 && f->order_count <= 99999999) | 7340 if (FRAME_TTY_P (f) && f->order_count > 1 && f->order_count <= 99999999) |
7341 { | 7341 { |
7342 /* Naughty, naughty */ | 7342 /* Naughty, naughty */ |
7343 char * writable_str = alloca_array (char, 10); | 7343 Ascbyte *writable_str = alloca_array (Ascbyte, 10); |
7344 sprintf (writable_str, "-%d", f->order_count); | 7344 sprintf (writable_str, "-%d", f->order_count); |
7345 str = writable_str; | 7345 str = writable_str; |
7346 } | 7346 } |
7347 } | 7347 } |
7348 #endif /* HAVE_TTY */ | 7348 #endif /* HAVE_TTY */ |
7420 str = "Top"; | 7420 str = "Top"; |
7421 else | 7421 else |
7422 { | 7422 { |
7423 /* This hard limit is ok since the string it will hold has a | 7423 /* This hard limit is ok since the string it will hold has a |
7424 fixed maximum length of 3. But just to be safe... */ | 7424 fixed maximum length of 3. But just to be safe... */ |
7425 char buf[10]; | 7425 Ascbyte buf[10]; |
7426 Charcount chars = pos - BUF_BEGV (b); | 7426 Charcount chars = pos - BUF_BEGV (b); |
7427 Charcount total = BUF_ZV (b) - BUF_BEGV (b); | 7427 Charcount total = BUF_ZV (b) - BUF_BEGV (b); |
7428 | 7428 |
7429 /* Avoid overflow on big buffers */ | 7429 /* Avoid overflow on big buffers */ |
7430 int percent = total > LONG_MAX/200 ? | 7430 int percent = total > LONG_MAX/200 ? |
7467 } | 7467 } |
7468 else | 7468 else |
7469 { | 7469 { |
7470 /* This hard limit is ok since the string it will hold has a | 7470 /* This hard limit is ok since the string it will hold has a |
7471 fixed maximum length of around 6. But just to be safe... */ | 7471 fixed maximum length of around 6. But just to be safe... */ |
7472 char buf[10]; | 7472 Ascbyte buf[10]; |
7473 Charcount chars = botpos - BUF_BEGV (b); | 7473 Charcount chars = botpos - BUF_BEGV (b); |
7474 Charcount total = BUF_ZV (b) - BUF_BEGV (b); | 7474 Charcount total = BUF_ZV (b) - BUF_BEGV (b); |
7475 | 7475 |
7476 /* Avoid overflow on big buffers */ | 7476 /* Avoid overflow on big buffers */ |
7477 int percent = total > LONG_MAX/200 ? | 7477 int percent = total > LONG_MAX/200 ? |