Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "John S Kallal" <jskallal@home.com>
To: <gdb-patches@sources.redhat.com>
Subject: [PATCH] Small cleanup of GDBSERVER code
Date: Thu, 26 Apr 2001 16:39:00 -0000	[thread overview]
Message-ID: <002f01c0ceaa$5198bb60$6401a8c0@cn986452a> (raw)

The following are some cleanups to the GSBSERVER code.

2001-04-26  John S Kallal  <jskallal@home.com>

 * server.c (main): Removed unneeded local variable.
 * remote-utils.c (input_interrupt): Added unused
 calling argument to match single UNIX specification.
 * remote-utils.c (remote_open, putpkt, convert_int_to_ascii,
 convert_ascii_to_int): Changed a calling argument pointer
 from char * to const char *.
 * server.h: Likewise changes to the function prototypes.







diff -u -r gdb-org/gdbserver/remote-utils.c gdb/gdbserver/remote-utils.c
--- gdb-org/gdbserver/remote-utils.c Tue Mar  6 03:21:44 2001
+++ gdb/gdbserver/remote-utils.c Thu Apr 26 10:58:20 2001
@@ -42,7 +42,7 @@
    NAME is the filename used for communication.  */

 void
-remote_open (char *name)
+remote_open (const char *name)
 {
   int save_fcntl_flags;

@@ -195,7 +195,7 @@
    The data of the packet is in BUF.  Returns >= 0 on success, -1
otherwise. */

 int
-putpkt (char *buf)
+putpkt (const char *buf)
 {
   int i;
   unsigned char csum = 0;
@@ -259,7 +259,7 @@
    will cause us to send a SIGINT to the child.  */

 static void
-input_interrupt (void)
+input_interrupt ( int unused )
 {
   int cc;
   char c;
@@ -393,7 +393,7 @@
 }

 void
-convert_int_to_ascii (char *from, char *to, int n)
+convert_int_to_ascii (const char *from, char *to, int n)
 {
   int nib;
   char ch;
@@ -410,7 +410,7 @@


 void
-convert_ascii_to_int (char *from, char *to, int n)
+convert_ascii_to_int (const char *from, char *to, int n)
 {
   int nib1, nib2;
   while (n--)
@@ -497,7 +497,7 @@
 }

 void
-decode_m_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int
*len_ptr)
+decode_m_packet (const char *from, CORE_ADDR *mem_addr_ptr, unsigned int
*len_ptr)
 {
   int i = 0, j = 0;
   char ch;
@@ -519,7 +519,7 @@
 }

 void
-decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int
*len_ptr,
+decode_M_packet (const char *from, CORE_ADDR *mem_addr_ptr, unsigned int
*len_ptr,
    char *to)
 {
   int i = 0;
diff -u -r gdb-org/gdbserver/server.c gdb/gdbserver/server.c
--- gdb-org/gdbserver/server.c Tue Mar  6 03:21:44 2001
+++ gdb/gdbserver/server.c Thu Apr 26 10:29:20 2001
@@ -45,7 +45,6 @@
 main (int argc, char *argv[])
 {
   char ch, status, own_buf[PBUFSIZ], mem_buf[2000];
-  int i = 0;
   unsigned char signal;
   unsigned int len;
   CORE_ADDR mem_addr;
@@ -75,8 +74,7 @@
       while (getpkt (own_buf) > 0)
  {
    unsigned char sig;
-   i = 0;
-   ch = own_buf[i++];
+   ch = own_buf[0];
    switch (ch)
      {
      case 'd':
diff -u -r gdb-org/gdbserver/server.h gdb/gdbserver/server.h
--- gdb-org/gdbserver/server.h Tue Mar  6 03:21:44 2001
+++ gdb/gdbserver/server.h Thu Apr 26 14:22:46 2001
@@ -33,8 +33,7 @@
 unsigned char mywait (char *status);
 void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
 int write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
-int create_inferior ();
-void initialize_low ();
+void initialize_low (void);

 /* Target-specific variables */

@@ -52,21 +51,21 @@

 /* Functions from remote-utils.c */

-int putpkt (char *buf);
+int putpkt (const char *buf);
 int getpkt (char *buf);
-void remote_open (char *name);
+void remote_open (const char *name);
 void remote_close (void);
 void write_ok (char *buf);
 void write_enn (char *buf);
 void enable_async_io (void);
 void disable_async_io (void);
-void convert_ascii_to_int (char *from, char *to, int n);
-void convert_int_to_ascii (char *from, char *to, int n);
+void convert_ascii_to_int (const char *from, char *to, int n);
+void convert_int_to_ascii (const char *from, char *to, int n);
 void prepare_resume_reply (char *buf, char status, unsigned char sig);

-void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
+void decode_m_packet (const char *from, CORE_ADDR * mem_addr_ptr,
         unsigned int *len_ptr);
-void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
+void decode_M_packet (const char *from, CORE_ADDR * mem_addr_ptr,
         unsigned int *len_ptr, char *to);





                 reply	other threads:[~2001-04-26 16:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002f01c0ceaa$5198bb60$6401a8c0@cn986452a' \
    --to=jskallal@home.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox