FreeBSD Bugzilla – Attachment 150516 Details for
Bug 195929
usr.bin/sed -- constify, remove line-length limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add consts, where appropriate
sed.patch (text/plain), 2.09 KB, created by
Mikhail T.
on 2014-12-12 21:56:35 UTC
(
hide
)
Description:
Add consts, where appropriate
Filename:
MIME Type:
Creator:
Mikhail T.
Created:
2014-12-12 21:56:35 UTC
Size:
2.09 KB
patch
obsolete
>Index: extern.h >=================================================================== >--- extern.h (revision 274711) >+++ extern.h (working copy) >@@ -53,4 +53,4 @@ > int lastline(void); > void process(void); > void resetstate(void); >-char *strregerror(int, regex_t *); >+const char *strregerror(int, const regex_t *); >Index: main.c >=================================================================== >--- main.c (revision 274711) >+++ main.c (working copy) >@@ -73,7 +73,7 @@ > struct s_compunit { > struct s_compunit *next; > enum e_cut {CU_FILE, CU_STRING} type; >- char *s; /* Pointer to string or fname */ >+ const char *s; /* Pointer to string or fname */ > }; > > /* >@@ -86,7 +86,7 @@ > * Linked list of files to be processed > */ > struct s_flist { >- char *fname; >+ const char *fname; > struct s_flist *next; > }; > >@@ -117,8 +117,8 @@ > static const char *inplace; /* Inplace edit file extension. */ > u_long linenum; > >-static void add_compunit(enum e_cut, char *); >-static void add_file(char *); >+static void add_compunit(enum e_cut, const char *); >+static void add_file(const char *); > static void usage(void); > > int >@@ -219,7 +214,7 @@ > { > static enum {ST_EOF, ST_FILE, ST_STRING} state = ST_EOF; > static FILE *f; /* Current open file */ >- static char *s; /* Current pointer inside string */ >+ static const char *s; /* Current pointer inside string */ > static char string_ident[30]; > char *p; > >@@ -452,7 +447,7 @@ > * Add a compilation unit to the linked list > */ > static void >-add_compunit(enum e_cut type, char *s) >+add_compunit(enum e_cut type, const char *s) > { > struct s_compunit *cu; > >@@ -469,7 +464,7 @@ > * Add a file to the linked list > */ > static void >-add_file(char *s) >+add_file(const char *s) > { > struct s_flist *fp; > >Index: misc.c >=================================================================== >--- misc.c (revision 274711) >+++ misc.c (working copy) >@@ -55,8 +55,8 @@ > * because of the silly semantics of regerror (we can never know the size of > * the buffer). > */ >-char * >-strregerror(int errcode, regex_t *preg) >+const char * >+strregerror(int errcode, const regex_t *preg) > { > static char *oe; > size_t s;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195929
:
150515
|
150516
|
150518
|
150536
|
150558
|
150663
|
152797
|
153006
|
171898
|
171900
|
172273
|
172402
|
172403
|
172409
|
172442
|
172615
|
172616
|
172618