* cygcheck.cc (pathlike::check_existence): Remove class name from declaration.
(display_internet_error): Use proper format specifier for DWORD. (environ): Remove unneeded declaration. (main): Use brace around nested if to avoid an overly-helpful compiler warning. * dump_setup.cc (parse_filename): Reorganize nested if to avoid an overly-helpful compiler warning. * path.cc (GUID_shortcut): Use braces around part of initializer which needs them. (conv_fstab_spaces): Parenthesize assignment in while loop to avoid a compiler warning. (struct opt): Make static. * ps.cc (main): Reorganize nested if to avoid an overly-helpful compiler warning. * regtool.cc: Make some anonymous structs static to avoid a compiler warning. * ssp.c (lookup_thread_id): Initialize *tix to zero to avoid potential uninitialized use. * strace.cc (add_child): Use proper format specifier for DWORD. (remove_child): Ditto. (proc_child): Ditto.
This commit is contained in:
		@@ -1,3 +1,28 @@
 | 
			
		||||
2008-09-12  Christopher Faylor  <me+cygwin@cgf.cx>
 | 
			
		||||
 | 
			
		||||
	* cygcheck.cc (pathlike::check_existence): Remove class name from
 | 
			
		||||
	declaration.
 | 
			
		||||
	(display_internet_error): Use proper format specifier for DWORD.
 | 
			
		||||
	(environ): Remove unneeded declaration.
 | 
			
		||||
	(main): Use brace around nested if to avoid an overly-helpful compiler
 | 
			
		||||
	warning.
 | 
			
		||||
	* dump_setup.cc (parse_filename): Reorganize nested if to avoid an
 | 
			
		||||
	overly-helpful compiler warning.
 | 
			
		||||
	* path.cc (GUID_shortcut): Use braces around part of initializer which
 | 
			
		||||
	needs them.
 | 
			
		||||
	(conv_fstab_spaces): Parenthesize assignment in while loop to avoid a
 | 
			
		||||
	compiler warning.
 | 
			
		||||
	(struct opt): Make static.
 | 
			
		||||
	* ps.cc (main): Reorganize nested if to avoid an overly-helpful
 | 
			
		||||
	compiler warning.
 | 
			
		||||
	* regtool.cc: Make some anonymous structs static to avoid a compiler
 | 
			
		||||
	warning.
 | 
			
		||||
	* ssp.c (lookup_thread_id): Initialize *tix to zero to avoid potential
 | 
			
		||||
	uninitialized use.
 | 
			
		||||
	* strace.cc (add_child): Use proper format specifier for DWORD.
 | 
			
		||||
	(remove_child): Ditto.
 | 
			
		||||
	(proc_child): Ditto.
 | 
			
		||||
 | 
			
		||||
2008-08-27  Christopher Faylor  <me+cygwin@cgf.cx>
 | 
			
		||||
 | 
			
		||||
	* cygcheck.cc (nuke): Use malloc rather than alloca for environment
 | 
			
		||||
 
 | 
			
		||||
@@ -124,9 +124,9 @@ struct pathlike
 | 
			
		||||
{
 | 
			
		||||
  char *dir;
 | 
			
		||||
  bool issys;
 | 
			
		||||
  void pathlike::check_existence (const char *fn, int showall, int verbose,
 | 
			
		||||
				  char* first, const char *ext1 = "",
 | 
			
		||||
				  const char *ext2 = "");
 | 
			
		||||
  void check_existence (const char *fn, int showall, int verbose,
 | 
			
		||||
			char* first, const char *ext1 = "",
 | 
			
		||||
			const char *ext2 = "");
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
pathlike *paths;
 | 
			
		||||
@@ -201,7 +201,7 @@ display_internet_error (const char *message, ...)
 | 
			
		||||
	  sizeof (err_buf), NULL) == 0)
 | 
			
		||||
	strcpy (err_buf, "(Unknown error)");
 | 
			
		||||
 | 
			
		||||
      fprintf (stderr, "cygcheck: %s: %s (win32 error %d)\n", message,
 | 
			
		||||
      fprintf (stderr, "cygcheck: %s: %s (win32 error %lu)\n", message,
 | 
			
		||||
	       err_buf, err);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
@@ -901,9 +901,6 @@ cygcheck (const char *app)
 | 
			
		||||
  return track_down (papp, ".exe", 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern char **environ;
 | 
			
		||||
 | 
			
		||||
struct RegInfo
 | 
			
		||||
{
 | 
			
		||||
  RegInfo *prev;
 | 
			
		||||
@@ -2115,11 +2112,13 @@ main (int argc, char **argv)
 | 
			
		||||
  if (posixly == NULL)
 | 
			
		||||
    putenv ("POSIXLY_CORRECT=");
 | 
			
		||||
 | 
			
		||||
  if (argc == 0 && !sysinfo && !keycheck && !check_setup && !list_package)
 | 
			
		||||
    if (givehelp)
 | 
			
		||||
      usage (stdout, 0);
 | 
			
		||||
    else
 | 
			
		||||
      usage (stderr, 1);
 | 
			
		||||
  if ((argc == 0) && !sysinfo && !keycheck && !check_setup && !list_package)
 | 
			
		||||
    {
 | 
			
		||||
      if (givehelp)
 | 
			
		||||
	usage (stdout, 0);
 | 
			
		||||
      else
 | 
			
		||||
	usage (stderr, 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if ((check_setup || sysinfo || find_package || list_package || grep_packages)
 | 
			
		||||
      && keycheck)
 | 
			
		||||
 
 | 
			
		||||
@@ -91,24 +91,25 @@ parse_filename (const char *in_fn, fileparse& f)
 | 
			
		||||
  f.pkg[0] = f.what[0] = '\0';
 | 
			
		||||
  p = base (fn);
 | 
			
		||||
  for (ver = p; *ver; ver++)
 | 
			
		||||
    if (*ver == '-')
 | 
			
		||||
      if (isdigit (ver[1]))
 | 
			
		||||
	{
 | 
			
		||||
	  *ver++ = '\0';
 | 
			
		||||
	  strcpy (f.pkg, p);
 | 
			
		||||
	  break;
 | 
			
		||||
	}
 | 
			
		||||
      else if (strcasecmp (ver, "-src") == 0 ||
 | 
			
		||||
	       strcasecmp (ver, "-patch") == 0)
 | 
			
		||||
	{
 | 
			
		||||
	  *ver++ = '\0';
 | 
			
		||||
	  strcpy (f.pkg, p);
 | 
			
		||||
	  strcpy (f.what, strlwr (ver));
 | 
			
		||||
	  strcpy (f.pkgtar, p);
 | 
			
		||||
	  strcat (f.pkgtar, f.tail);
 | 
			
		||||
	  ver = strchr (ver, '\0');
 | 
			
		||||
	  break;
 | 
			
		||||
	}
 | 
			
		||||
    if (*ver != '-')
 | 
			
		||||
      continue;
 | 
			
		||||
    else if (isdigit (ver[1]))
 | 
			
		||||
      {
 | 
			
		||||
	*ver++ = '\0';
 | 
			
		||||
	strcpy (f.pkg, p);
 | 
			
		||||
	break;
 | 
			
		||||
      }
 | 
			
		||||
    else if (strcasecmp (ver, "-src") == 0 ||
 | 
			
		||||
	     strcasecmp (ver, "-patch") == 0)
 | 
			
		||||
      {
 | 
			
		||||
	*ver++ = '\0';
 | 
			
		||||
	strcpy (f.pkg, p);
 | 
			
		||||
	strcpy (f.what, strlwr (ver));
 | 
			
		||||
	strcpy (f.pkgtar, p);
 | 
			
		||||
	strcat (f.pkgtar, f.tail);
 | 
			
		||||
	ver = strchr (ver, '\0');
 | 
			
		||||
	break;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
  if (!f.pkg[0])
 | 
			
		||||
    strcpy (f.pkg, p);
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@ details. */
 | 
			
		||||
   })
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const GUID GUID_shortcut
 | 
			
		||||
			= { 0x00021401L, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46 };
 | 
			
		||||
static const GUID GUID_shortcut =
 | 
			
		||||
  {0x00021401L, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  WSH_FLAG_IDLIST = 0x01,	/* Contains an ITEMIDLIST. */
 | 
			
		||||
@@ -276,7 +276,7 @@ inline char *
 | 
			
		||||
conv_fstab_spaces (char *field)
 | 
			
		||||
{
 | 
			
		||||
  register char *sp = field;
 | 
			
		||||
  while (sp = strstr (sp, "\\040"))
 | 
			
		||||
  while ((sp = strstr (sp, "\\040")) != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      *sp++ = ' ';
 | 
			
		||||
      memmove (sp, sp + 3, strlen (sp + 3) + 1);
 | 
			
		||||
@@ -284,7 +284,7 @@ conv_fstab_spaces (char *field)
 | 
			
		||||
  return field;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct opt
 | 
			
		||||
static struct opt
 | 
			
		||||
{
 | 
			
		||||
  const char *name;
 | 
			
		||||
  unsigned val;
 | 
			
		||||
@@ -503,7 +503,7 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
static int
 | 
			
		||||
mnt_sort (const void *a, const void *b)
 | 
			
		||||
{
 | 
			
		||||
  const mnt_t *ma = (const mnt_t *) a;
 | 
			
		||||
 
 | 
			
		||||
@@ -344,14 +344,15 @@ main (int argc, char *argv[])
 | 
			
		||||
      if ((proc_id > 0) && (p->pid != proc_id))
 | 
			
		||||
	continue;
 | 
			
		||||
 | 
			
		||||
      if (!aflag)
 | 
			
		||||
	if (p->version >= EXTERNAL_PINFO_VERSION_32_BIT)
 | 
			
		||||
	  {
 | 
			
		||||
	    if (p->uid32 != (__uid32_t) uid)
 | 
			
		||||
	      continue;
 | 
			
		||||
	  }
 | 
			
		||||
	else if (p->uid != uid)
 | 
			
		||||
	  continue;
 | 
			
		||||
      if (aflag)
 | 
			
		||||
	/* nothing to do */;
 | 
			
		||||
      else if (p->version >= EXTERNAL_PINFO_VERSION_32_BIT)
 | 
			
		||||
	{
 | 
			
		||||
	  if (p->uid32 != (__uid32_t) uid)
 | 
			
		||||
	    continue;
 | 
			
		||||
	}
 | 
			
		||||
      else if (p->uid != uid)
 | 
			
		||||
	continue;
 | 
			
		||||
      char status = ' ';
 | 
			
		||||
      if (p->process_state & PID_STOPPED)
 | 
			
		||||
	status = 'S';
 | 
			
		||||
 
 | 
			
		||||
@@ -202,7 +202,7 @@ Fail (DWORD rv)
 | 
			
		||||
  exit (1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct
 | 
			
		||||
static struct
 | 
			
		||||
{
 | 
			
		||||
  const char *string;
 | 
			
		||||
  HKEY key;
 | 
			
		||||
@@ -865,8 +865,7 @@ cmd_save ()
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct
 | 
			
		||||
static struct
 | 
			
		||||
{
 | 
			
		||||
  const char *name;
 | 
			
		||||
  int (*func) ();
 | 
			
		||||
 
 | 
			
		||||
@@ -161,10 +161,12 @@ static HANDLE
 | 
			
		||||
lookup_thread_id (DWORD threadId, int *tix)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
  *tix = 0;
 | 
			
		||||
  for (i=0; i<num_active_threads; i++)
 | 
			
		||||
    if (active_thread_ids[i] == threadId)
 | 
			
		||||
      {
 | 
			
		||||
	if (tix) *tix = i;
 | 
			
		||||
	if (tix)
 | 
			
		||||
	  *tix = i;
 | 
			
		||||
	return active_threads[i];
 | 
			
		||||
      }
 | 
			
		||||
  return 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -131,7 +131,7 @@ add_child (DWORD id, HANDLE hproc)
 | 
			
		||||
      lasth = children.next->hproc = hproc;
 | 
			
		||||
      processes++;
 | 
			
		||||
      if (!quiet)
 | 
			
		||||
	fprintf (stderr, "Windows process %d attached\n", id);
 | 
			
		||||
	fprintf (stderr, "Windows process %lu attached\n", id);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -148,7 +148,7 @@ remove_child (DWORD id)
 | 
			
		||||
	c->next = c1->next;
 | 
			
		||||
	free (c1);
 | 
			
		||||
	if (!quiet)
 | 
			
		||||
	  fprintf (stderr, "Windows process %d detached\n", id);
 | 
			
		||||
	  fprintf (stderr, "Windows process %lu detached\n", id);
 | 
			
		||||
	processes--;
 | 
			
		||||
	return;
 | 
			
		||||
      }
 | 
			
		||||
@@ -650,7 +650,7 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid)
 | 
			
		||||
	    {
 | 
			
		||||
	      status = DBG_EXCEPTION_NOT_HANDLED;
 | 
			
		||||
	      if (ev.u.Exception.dwFirstChance)
 | 
			
		||||
		fprintf (ofile, "--- Process %u, exception %p at %p\n", ev.dwProcessId,
 | 
			
		||||
		fprintf (ofile, "--- Process %lu, exception %p at %p\n", ev.dwProcessId,
 | 
			
		||||
			 ev.u.Exception.ExceptionRecord.ExceptionCode,
 | 
			
		||||
			 ev.u.Exception.ExceptionRecord.ExceptionAddress);
 | 
			
		||||
	    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user