1
1

2000-10-22 Andrew V. Samoilov <sav@bcs.zp.ua>

* samba/libsmb/nterr.c (nt_errs): constified

	* samba/libsmb/smberr.c (dos_msgs, server_msgs, hard_msgs,
	err_classes): ditto

	(smb_errstr): err constified to avoid warnings
Этот коммит содержится в:
Andrew V. Samoilov 2000-10-22 15:04:41 +00:00
родитель f30f7e2e5c
Коммит 75928247d3
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -10,7 +10,7 @@ typedef struct
} nt_err_code_struct; } nt_err_code_struct;
nt_err_code_struct nt_errs[] = nt_err_code_struct const nt_errs[] =
{ {
{ "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL }, { "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL },
{ "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED }, { "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED },

Просмотреть файл

@ -35,7 +35,7 @@ typedef struct
} err_code_struct; } err_code_struct;
/* Dos Error Messages */ /* Dos Error Messages */
err_code_struct dos_msgs[] = { static err_code_struct const dos_msgs[] = {
{"ERRbadfunc",1,"Invalid function."}, {"ERRbadfunc",1,"Invalid function."},
{"ERRbadfile",2,"File not found."}, {"ERRbadfile",2,"File not found."},
{"ERRbadpath",3,"Directory invalid."}, {"ERRbadpath",3,"Directory invalid."},
@ -68,7 +68,7 @@ err_code_struct dos_msgs[] = {
{NULL,-1,NULL}}; {NULL,-1,NULL}};
/* Server Error Messages */ /* Server Error Messages */
err_code_struct server_msgs[] = { static err_code_struct const server_msgs[] = {
{"ERRerror",1,"Non-specific error code."}, {"ERRerror",1,"Non-specific error code."},
{"ERRbadpw",2,"Bad password - name/password pair in a Tree Connect or Session Setup are invalid."}, {"ERRbadpw",2,"Bad password - name/password pair in a Tree Connect or Session Setup are invalid."},
{"ERRbadtype",3,"reserved."}, {"ERRbadtype",3,"reserved."},
@ -104,7 +104,7 @@ err_code_struct server_msgs[] = {
{NULL,-1,NULL}}; {NULL,-1,NULL}};
/* Hard Error Messages */ /* Hard Error Messages */
err_code_struct hard_msgs[] = { static err_code_struct const hard_msgs[] = {
{"ERRnowrite",19,"Attempt to write on write-protected diskette."}, {"ERRnowrite",19,"Attempt to write on write-protected diskette."},
{"ERRbadunit",20,"Unknown unit."}, {"ERRbadunit",20,"Unknown unit."},
{"ERRnotready",21,"Drive not ready."}, {"ERRnotready",21,"Drive not ready."},
@ -130,8 +130,8 @@ struct
{ {
int code; int code;
char *class; char *class;
err_code_struct *err_msgs; err_code_struct const *err_msgs;
} err_classes[] = { } const err_classes [] = {
{0,"SUCCESS",NULL}, {0,"SUCCESS",NULL},
{0x01,"ERRDOS",dos_msgs}, {0x01,"ERRDOS",dos_msgs},
{0x02,"ERRSRV",server_msgs}, {0x02,"ERRSRV",server_msgs},
@ -159,7 +159,7 @@ char *smb_errstr(char *inbuf)
{ {
if (err_classes[i].err_msgs) if (err_classes[i].err_msgs)
{ {
err_code_struct *err = err_classes[i].err_msgs; const err_code_struct *err = err_classes[i].err_msgs;
for (j=0;err[j].name;j++) for (j=0;err[j].name;j++)
if (num == err[j].code) if (num == err[j].code)
{ {