* Re: procps-1.01 patches
@ 1996-06-17 17:11 David Mosberger-Tang
0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger-Tang @ 1996-06-17 17:11 UTC (permalink / raw)
>>>>> On Mon, 17 Jun 1996 12:01:35 +0200 (MET DST), koenig@tat.physik.uni-tuebingen.de (Harald Koenig) said:
Harald> just using base==0 for XtGetApplicationResources() is not
Harald> portable when sizeof(int) < sizeof (void*). I've tested the
Harald> patch below on i386 too.
Yes, my patch had that fixed already:
--- procps-1.01/xcpustate/xcpustate.c Tue May 28 11:01:12 1996
+++ procps-1.01axp/xcpustate/xcpustate.c Sun Jun 16 16:06:26 1996
@@ -18,19 +18,23 @@
#define MAXSTR 512
#define DEF_INTERVAL 1
-#define DEF_COUNT -1
+#define DEF_COUNT -1
char *progname;
static int defaultInterval = DEF_INTERVAL;
static int defaultCount = DEF_COUNT;
-static int count, interval;
+static struct {
+ int count, interval;
+} appres;
/* Application Resources - no particular widget */
static XtResource application_resources[] = {
{"interval", "Interval", XtRInt, sizeof(int),
- (Cardinal)&interval, XtRInt, (caddr_t) &defaultInterval},
+ (char *) &appres.interval - (char *) &appres, XtRInt,
+ (caddr_t) &defaultInterval},
{"count", "Count", XtRInt, sizeof(int),
- (Cardinal)&count, XtRInt, (caddr_t) &defaultCount},
+ (char *) &appres.count - (char *) &appres, XtRInt,
+ (caddr_t) &defaultCount},
};
/*
I'm not sure what solution is better, but it is OK to compute the
difference of two pointers at link time. The linker/gcc just refuses
to truncate a pointer to 32 bits at link time.
>> Harald, now I have a bug report for you (or any X-server hacker,
>> I suppose): xcpustate prints the bar-chart all in black when
>> running the latest XF86_S3 server in 16bpp mode. In 8bpp mode,
>> the stippling works just fine. Bug or feature?
Harald> client bug; patch see below. I don't like this b/w display
Harald> so I never run xcpustate other than for a quick compilation
Harald> check (which almost ever happens on 8bpp as my default
Harald> depth).
Ah, yes, this fixes the problem. I don't like the looks of xcpustate
either, but it's nice to have these things working. xsysinfo does
look better, but it also takes more screen real-estate. Anyhow,
thanks for the fix!
--david
^ permalink raw reply [flat|nested] 3+ messages in thread* procps-1.01 patches
@ 1996-06-17 3:09 David Mosberger-Tang
1996-06-17 10:01 ` Harald Koenig
0 siblings, 1 reply; 3+ messages in thread
From: David Mosberger-Tang @ 1996-06-17 3:09 UTC (permalink / raw)
OK, I bit the bullet and upgraded to procps-1.01. There is now a new
patch at:
ftp://ftp.azstarnet.com/pub/linux/axp/glibc/procps-1.01axp.patch.gz
It should have all the old procps fixes plus some fixes by Kazushige
Goto and by Harald Koenig (but I was in a hurry, so more testing will
be needed). I modified psupdate so it can accept either a.out or
ELF-style binaries or if these don't work, it falls back to using BFD
(as long as BFD-support has been configured in, which is the default
for Linux/Alpha).
Oh, there are also some other minor fixes the get things working with
glibc (the utmp entry there allows a hostname of up to 256 characters,
which resulted in a funny behavior in w).
Charles, would you mind integrating these patches into your source
tree? None of the patches should break anything for the x86 (I wasn't
able to test elfupdate and aoutupdate, but I was careful not to break
anything, so I hope they will still work just fine).
Harald, now I have a bug report for you (or any X-server hacker, I
suppose): xcpustate prints the bar-chart all in black when running the
latest XF86_S3 server in 16bpp mode. In 8bpp mode, the stippling
works just fine. Bug or feature?
cheers,
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: procps-1.01 patches
1996-06-17 3:09 David Mosberger-Tang
@ 1996-06-17 10:01 ` Harald Koenig
0 siblings, 0 replies; 3+ messages in thread
From: Harald Koenig @ 1996-06-17 10:01 UTC (permalink / raw)
> OK, I bit the bullet and upgraded to procps-1.01. There is now a new
> patch at:
>
> ftp://ftp.azstarnet.com/pub/linux/axp/glibc/procps-1.01axp.patch.gz
I haven't checked your patches yet but here are some patches for
xcpustate which fix the 16/32bpp problem and also fixes the problem.
of resource initialisation.
just using base==0 for XtGetApplicationResources() is not portable
when sizeof(int) < sizeof (void*). I've tested the patch below on
i386 too.
> Harald, now I have a bug report for you (or any X-server hacker, I
> suppose): xcpustate prints the bar-chart all in black when running the
> latest XF86_S3 server in 16bpp mode. In 8bpp mode, the stippling
> works just fine. Bug or feature?
client bug; patch see below. I don't like this b/w display so I never
run xcpustate other than for a quick compilation check (which almost
ever happens on 8bpp as my default depth).
-------------------------------------------------------------------------------
--- procps-1.01/xcpustate/xcpustate.c.orig Mon Jun 17 09:49:00 1996
+++ procps-1.01/xcpustate/xcpustate.c Mon Jun 17 11:03:06 1996
@@ -28,9 +28,9 @@
/* Application Resources - no particular widget */
static XtResource application_resources[] = {
{"interval", "Interval", XtRInt, sizeof(int),
- (Cardinal)&interval, XtRInt, (caddr_t) &defaultInterval},
+ 0, XtRInt, (caddr_t) &defaultInterval},
{"count", "Count", XtRInt, sizeof(int),
- (Cardinal)&count, XtRInt, (caddr_t) &defaultCount},
+ 0, XtRInt, (caddr_t) &defaultCount},
};
/*
@@ -147,8 +147,13 @@
if (argc > 1)
usage();
-
- XtGetApplicationResources(topLevel, 0, application_resources,
+
+ application_resources[0].resource_offset =
+ (Cardinal)&interval - (Cardinal)&application_resources;
+ application_resources[1].resource_offset =
+ (Cardinal)&count - (Cardinal)&application_resources;
+
+ XtGetApplicationResources(topLevel, application_resources, application_resources,
XtNumber(application_resources), NULL, 0 );
form = XtCreateManagedWidget("form", formWidgetClass, topLevel,
--- procps-1.01/xcpustate/Bar.c.orig Mon Jun 17 11:14:51 1996
+++ procps-1.01/xcpustate/Bar.c Mon Jun 17 11:45:43 1996
@@ -160,15 +160,15 @@
bcp->gray = (Pixmap *) XtMalloc(MAXGRAY * sizeof(Pixmap));
for(i = 0; i < MAXGRAY; i++) {
bcp->gray[i] = XCreatePixmapFromBitmapData(XtDisplay(new),
- DefaultRootWindow(XtDisplay(new)), gray_bits[i], 3, 3,
- WhitePixelOfScreen(XtScreen(new)),
- BlackPixelOfScreen(XtScreen(new)), 1);
+ DefaultRootWindow(XtDisplay(new)), gray_bits[i], 3, 3, 1, 0, 1);
}
}
gcValues.stipple = bcp->gray[0];
gcValues.fill_style = FillOpaqueStippled;
+ gcValues.foreground = BlackPixelOfScreen(XtScreen(new));
+ gcValues.background = WhitePixelOfScreen(XtScreen(new));
w->bar.gc = XCreateGC(XtDisplay(new), DefaultRootWindow(XtDisplay(new)),
- GCFillStyle | GCStipple, &gcValues);
+ GCFillStyle | GCStipple | GCForeground | GCBackground, &gcValues);
/* Width and height override length and thickness */
if (w->bar.length == def_dimension)
w->bar.length = DEF_LENGTH;
--
All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \
koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-06-17 17:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-06-17 17:11 procps-1.01 patches David Mosberger-Tang
-- strict thread matches above, loose matches on Subject: below --
1996-06-17 3:09 David Mosberger-Tang
1996-06-17 10:01 ` Harald Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox