PATCH: formatting fixes in files/smb.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I had submitted the following last summer, because the original code
really had made it more difficult for me to track down a bug:

  We certainly should not get anal rentative on this, but something like
    int trn = 1234,i=0;
  from files/smb.c where even a single line is inconsistent really
  makes me wonder.

  Also I am not aware of any coding style that asks for blanks around the
  assignment but does not use a blank after the comma.

  The patch below fixes at least the worst problems, by consistently using
  a blank after a comma in variable declarations.

This was in my local tree for 9 months.

ChangeLog:
  Fix formatting of variable declarations.

Index: smb.c
===================================================================
RCS file: /home/wine/wine/files/smb.c,v
retrieving revision 1.17
diff -u -3 -p -r1.17 smb.c
--- smb.c	15 Mar 2003 00:12:42 -0000	1.17
+++ smb.c	12 May 2003 06:44:10 -0000
@@ -127,7 +127,7 @@ struct NB_Buffer
 static int netbios_name(const char *p, unsigned char *buffer)
 {
     char ch;
-    int i,len=0;
+    int i, len=0;

     buffer[len++]=' ';
     for(i=0; i<=MAX_HOST_NAME; i++)
@@ -150,7 +150,7 @@ static int netbios_name(const char *p, u

 static DWORD NB_NameReq(LPCSTR host, unsigned char *buffer, int len)
 {
-    int trn = 1234,i=0;
+    int trn = 1234, i=0;

     NBR_ADDWORD(&buffer[i],trn);    i+=2;
     NBR_ADDWORD(&buffer[i],0x0110); i+=2;
@@ -207,9 +207,9 @@ static BOOL UNC_SplitName(LPSTR unc, LPS

 static BOOL NB_Lookup(LPCSTR host, struct sockaddr_in *addr)
 {
-    int fd,on=1,r,len,i,fromsize;
+    int fd, on=1, r, len, i, fromsize;
     struct pollfd fds;
-    struct sockaddr_in sin,fromaddr;
+    struct sockaddr_in sin, fromaddr;
     unsigned char buffer[256];

     fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -292,7 +292,7 @@ err:
 static BOOL NB_SessionReq(int fd, char *called, char *calling)
 {
     unsigned char buffer[0x100];
-    int len = 0,r;
+    int len = 0, r;
     struct pollfd fds;

     TRACE("called %s, calling %s\n",called,calling);
@@ -575,7 +575,7 @@ static BOOL SMB_NegotiateProtocol(int fd
 static BOOL SMB_SessionSetup(int fd, USHORT *userid)
 {
     unsigned char buf[0x100];
-    int pcount,bcount;
+    int pcount, bcount;
     struct NB_Buffer rx, tx;

     memset(buf,0,sizeof buf);
@@ -671,7 +671,7 @@ static BOOL SMB_TreeConnect(int fd, USHO
 {
     unsigned char buf[0x100];
     int slen;
-    struct NB_Buffer rx,tx;
+    struct NB_Buffer rx, tx;

     TRACE("%s\n",share_name);

@@ -735,7 +735,7 @@ static BOOL SMB_NtCreateOpen(int fd, USH
                               DWORD attributes, HANDLE template, USHORT *file_id )
 {
     unsigned char buffer[0x100];
-    int len = 0,slen;
+    int len = 0, slen;

     TRACE("%s\n",filename);

@@ -890,9 +890,9 @@ static BOOL SMB_Open(int fd, USHORT tree
                               DWORD creation, DWORD attributes, USHORT *file_id )
 {
     unsigned char buf[0x100];
-    int slen,pcount,i;
+    int slen, pcount, i;
     USHORT mode = SMB_GetMode(access,sharing);
-    struct NB_Buffer rx,tx;
+    struct NB_Buffer rx, tx;

     TRACE("%s\n",filename);

@@ -948,8 +948,8 @@ static BOOL SMB_Open(int fd, USHORT tree
 static BOOL SMB_Read(int fd, USHORT tree_id, USHORT user_id, USHORT dialect,
        USHORT file_id, DWORD offset, LPVOID out, USHORT count, USHORT* read)
 {
-    int buf_size,n,i;
-    struct NB_Buffer rx,tx;
+    int buf_size, n, i;
+    struct NB_Buffer rx, tx;

     TRACE("user %04x tree %04x file %04x count %04x offset %08lx\n",
         user_id, tree_id, file_id, count, offset);
@@ -1289,7 +1289,7 @@ done:

 static int SMB_GetSocket(LPCSTR host)
 {
-    int fd=-1,r;
+    int fd=-1, r;
     struct sockaddr_in sin;
     struct hostent *he;

@@ -1394,7 +1394,7 @@ HANDLE WINAPI SMB_CreateFileW( LPCWSTR u
 {
     int fd;
     USHORT tree_id=0, user_id=0, dialect=0, file_id=0;
-    LPSTR name,host,share,file;
+    LPSTR name, host, share, file;
     HANDLE handle = INVALID_HANDLE_VALUE;
     INT len;

@@ -1546,7 +1546,7 @@ BOOL WINAPI SMB_ReadFile(HANDLE hFile, L
 SMB_DIR* WINAPI SMB_FindFirst(LPCWSTR name)
 {
     int fd = -1;
-    LPSTR host,share,file;
+    LPSTR host, share, file;
     USHORT tree_id=0, user_id=0, dialect=0;
     SMB_DIR *ret = NULL;
     LPSTR filename;


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux