Changeset e19eb97 for editwin.c


Ignore:
Timestamp:
Aug 15, 2009, 7:08:18 PM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1077891a
Parents:
fa4562c
git-author:
Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
Message:
Add const qualifiers for char * and void *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r65b2173 re19eb97  
    4545static void oe_restore_excursion(owl_editwin *e, oe_excursion *x);
    4646static void oe_restore_mark_only(owl_editwin *e, oe_excursion *x);
    47 static int oe_count_glyphs(char *s);
     47static int oe_count_glyphs(const char *s);
    4848static int oe_char_width(gunichar c, int column);
    4949static int oe_region_width(owl_editwin *e, int start, int end, int width);
     
    5252static int owl_editwin_limit_maxcols(int v, int maxv);
    5353static int owl_editwin_check_dotsend(owl_editwin *e);
    54 static int owl_editwin_is_char_in(owl_editwin *e, char *set);
     54static int owl_editwin_is_char_in(owl_editwin *e, const char *set);
    5555static gunichar owl_editwin_get_char_at_point(owl_editwin *e);
    56 static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s);
    57 static char *oe_copy_buf(owl_editwin *e, char *buf, int len);
     56static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s);
     57static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len);
    5858static int oe_copy_region(owl_editwin *e);
    5959static char *oe_chunk(owl_editwin *e, int start, int end);
     
    7171}
    7272
    73 static int oe_count_glyphs(char *s)
     73static int oe_count_glyphs(const char *s)
    7474{
    7575  int count = 0;
    76   char *p;
     76  const char *p;
    7777
    7878  for(p = s; *p != 0; p = g_utf8_find_next_char(p, NULL))
     
    175175}
    176176
    177 void owl_editwin_set_command(owl_editwin *e, char *command)
     177void owl_editwin_set_command(owl_editwin *e, const char *command)
    178178{
    179179  if(e->command) owl_free(e->command);
     
    181181}
    182182
    183 char *owl_editwin_get_command(owl_editwin *e)
     183const char *owl_editwin_get_command(owl_editwin *e)
    184184{
    185185  if(e->command) return e->command;
     
    230230 * previous text (including locked text) will be overwritten
    231231 */
    232 void owl_editwin_set_locktext(owl_editwin *e, char *text)
     232void owl_editwin_set_locktext(owl_editwin *e, const char *text)
    233233{
    234234  oe_set_index(e, 0);
     
    378378}
    379379
    380 static inline char *oe_next_point(owl_editwin *e, char *p)
    381 {
    382   char *boundary = e->buff + e->bufflen + 1;
    383   char *q;
     380static inline const char *oe_next_point(owl_editwin *e, const char *p)
     381{
     382  const char *boundary = e->buff + e->bufflen + 1;
     383  const char *q;
    384384
    385385  q = g_utf8_find_next_char(p, boundary);
     
    392392}
    393393
    394 static inline char *oe_prev_point(owl_editwin *e, char *p)
    395 {
    396   char *boundary = e->buff + e->lock;
     394static inline const char *oe_prev_point(owl_editwin *e, const char *p)
     395{
     396  const char *boundary = e->buff + e->lock;
    397397
    398398  p = g_utf8_find_prev_char(boundary, p);
     
    422422  int width = 0, cw;
    423423  gunichar c;
    424   char *p;
     424  const char *p;
    425425
    426426  while(1) {
     
    576576}
    577577
    578 int owl_editwin_replace_region(owl_editwin *e, char *s)
     578int owl_editwin_replace_region(owl_editwin *e, const char *s)
    579579{
    580580  oe_excursion x;
     
    594594
    595595/* replace 'replace' characters at the point with s, returning the change in size */
    596 int owl_editwin_replace(owl_editwin *e, int replace, char *s)
     596int owl_editwin_replace(owl_editwin *e, int replace, const char *s)
    597597{
    598598  int start, end, i;
    599   char *p;
     599  const char *p;
    600600
    601601  if (!g_utf8_validate(s, -1, NULL)) {
     
    615615}
    616616
    617 static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s)
     617static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s)
    618618{
    619619  int start, end, free, need, size, change;
     
    694694void owl_editwin_transpose_chars(owl_editwin *e)
    695695{
    696   char *middle, *end, *start;
     696  const char *middle, *end, *start;
    697697  char *tmp;
    698698
     
    728728 * right
    729729 */
    730 void owl_editwin_insert_string(owl_editwin *e, char *s)
     730void owl_editwin_insert_string(owl_editwin *e, const char *s)
    731731{
    732732  owl_editwin_replace(e, 0, s);
     
    751751int owl_editwin_point_move(owl_editwin *e, int delta)
    752752{
    753   char *p;
     753  const char *p;
    754754  int change, d = 0;
    755755
     
    801801}
    802802
    803 static int owl_editwin_is_char_in(owl_editwin *e, char *set)
    804 {
    805   char *p;
     803static int owl_editwin_is_char_in(owl_editwin *e, const char *set)
     804{
     805  const char *p;
    806806
    807807  for (p = set; *p != 0; p = g_utf8_find_next_char(p, NULL))
     
    811811}
    812812
    813 int owl_editwin_move_if_in(owl_editwin *e, int delta, char *set)
     813int owl_editwin_move_if_in(owl_editwin *e, int delta, const char *set)
    814814{
    815815  int change, distance = 0;
     
    823823}
    824824
    825 int owl_editwin_move_if_not_in(owl_editwin *e, int delta, char *set)
     825int owl_editwin_move_if_not_in(owl_editwin *e, int delta, const char *set)
    826826{
    827827  int change, distance = 0;
     
    10301030}
    10311031
    1032 static char *oe_copy_buf(owl_editwin *e, char *buf, int len)
     1032static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len)
    10331033{
    10341034  char *p;
     
    10481048static int oe_copy_region(owl_editwin *e)
    10491049{
    1050   char *p;
     1050  const char *p;
    10511051  int start, end;
    10521052
     
    12371237static int oe_region_width(owl_editwin *e, int start, int end, int offset)
    12381238{
    1239   char *p;
     1239  const char *p;
    12401240  int width = offset;
    12411241 
     
    13171317}
    13181318
    1319 char *owl_editwin_get_text(owl_editwin *e)
     1319const char *owl_editwin_get_text(owl_editwin *e)
    13201320{
    13211321  return(e->buff+e->lock);
Note: See TracChangeset for help on using the changeset viewer.