1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

- Fix build under clang6

- replace pkg-plist with PLIST_FILES
- add LICENSE

Reported by:	pkg-fallout
This commit is contained in:
Diane Bruce 2018-01-19 01:22:11 +00:00
parent 7e5ac33691
commit 546b4fac95
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=459386
5 changed files with 191 additions and 3 deletions

View File

@ -11,9 +11,14 @@ MASTER_SITES= http://arvin.schnell-web.net/xanalyser/ \
MAINTAINER= db@FreeBSD.org
COMMENT= Spectrum analyser
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
USES= gmake libtool motif tar:bzip2
GNU_CONFIGURE= yes
PLIST_FILES= bin/xanalyser lib/X11/app-defaults/XAnalyser man/man1/xanalyser.1.gz
post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e 's|%%MOTIFLIB%%|${MOTIFLIB} |g' \

View File

@ -0,0 +1,128 @@
--- src/Analyser.cc.orig 2018-01-19 00:36:36 UTC
+++ src/Analyser.cc
@@ -146,7 +146,7 @@ Analyser::resize (bool redraw)
marker[1] = f2sx (f[1]);
if (redraw) {
- XRectangle rect = { 0, 0, width, height };
+ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
draw (rect);
}
}
@@ -169,7 +169,7 @@ Analyser::clear (bool drawit)
calcfoo ();
if (drawit) {
- XRectangle rect = { 0, 0, width, height };
+ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
draw (rect);
}
}
@@ -188,7 +188,7 @@ Analyser::drawpeaktext (bool showit)
snprintf (peak_text, 10, "%i", (int) peak_f);
- peak_sx = f2sx (peak_f) - (strlen (peak_text) * font_width) / 2;
+ peak_sx = f2sx (peak_f) - (strlen (peak_text) * font_width) / 2;
peak_sy = db2sy (peak_db) - 6;
XSetForeground (display, gc, xanalyser.markercolor);
@@ -203,7 +203,7 @@ void
Analyser::drawpeakmarker ()
{
for (int m = 0; m < 2; m++) {
- XRectangle rect = { marker[m], 0, 1, height };
+ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
draw (rect);
}
}
@@ -251,13 +251,13 @@ Analyser::drawgrid (bool withtext)
else
XSetForeground (display, gc, xanalyser.minorgridcolor);
- XDrawLine (display, window, gc, 0, sy, width - 1, sy);
+ XDrawLine (display, window, gc, 0, sy, static_cast<unsigned short>(width) - 1, sy);
if (withtext) {
const int size = 10;
char buffer[size];
snprintf (buffer, size, "%+d", db);
- XDrawString (display, window, gc, width - 2 - font_width *
+ XDrawString (display, window, gc, static_cast<unsigned short>(width) - 2 - font_width *
strlen (buffer), sy - 2, buffer, strlen (buffer));
}
}
@@ -280,7 +280,7 @@ Analyser::draw (XRectangle rect, bool complete)
if (complete) {
XSetForeground (display, gc, xanalyser.backgroundcolor);
- XFillRectangle (display, window, gc, 0, 0, width, height);
+ XFillRectangle (display, window, gc, 0, 0, static_cast<unsigned short>(width), height);
XSetForeground (display, gc, xanalyser.datacolor);
for (int sx = first; sx <= last; sx++) {
@@ -344,7 +344,7 @@ Analyser::realize (Display* display, Window window)
gc = XCreateGC (display, window, gc_mask, &gc_values);
- // get width and height
+ // get static_cast<unsigned short>(width) and height
myXGetDrawableSize (display, window, &width, &height);
@@ -382,8 +382,8 @@ Analyser::realize (Display* display, Window window)
envelope ();
marker[0] = 0;
- // note: it might be that width - 1 != num_fft - 1
- marker[1] = width - 1;
+ // note: it might be that static_cast<unsigned short>(width) - 1 != num_fft - 1
+ marker[1] = static_cast<unsigned short>(width) - 1;
return true;
}
@@ -427,7 +427,7 @@ Analyser::shot (const int32_t* buffer, int channel, bo
analyse (buffer, channel);
if (drawit) {
- XRectangle rect = { 0, 0, width, height };
+ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
draw (rect, false);
}
@@ -608,7 +608,7 @@ Analyser::set_search (bool search)
drawpeaktext (true);
for (int m = 0; m < 2; m++) {
- XRectangle rect = { marker[m], 0, 1, height };
+ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
draw (rect);
}
@@ -618,7 +618,7 @@ Analyser::set_search (bool search)
drawpeaktext (false);
for (int m = 0; m < 2; m++) {
- XRectangle rect = { marker[m], 0, 1, height };
+ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
draw (rect);
}
@@ -647,7 +647,7 @@ Analyser::set_marker (short sx)
// remove old marker and text
- XRectangle rect = { old, 0, 1, height };
+ XRectangle rect = { old, 0, 1, static_cast<unsigned short>(height) };
draw (rect);
XSetClipMask (display, gc, None);
@@ -662,7 +662,7 @@ Analyser::set_marker (short sx)
peaksearch (true);
for (int m = 0; m < 2; m++) {
- XRectangle rect = { marker[m], 0, 1, height };
+ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
draw (rect);
}

View File

@ -0,0 +1,29 @@
--- src/Scope.cc.orig 2018-01-19 00:47:02 UTC
+++ src/Scope.cc
@@ -132,7 +132,7 @@ Scope::resize (bool redraw)
clearbuffer ();
if (redraw) {
- XRectangle rect = { 0, 0, width, height };
+ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
draw (rect);
}
}
@@ -193,7 +193,7 @@ Scope::clear (bool drawit)
clearbuffer ();
if (drawit) {
- XRectangle rect = { 0, 0, width, height };
+ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
draw (rect);
}
}
@@ -310,7 +310,7 @@ Scope::shot (const int32_t* buffer, bool drawit)
}
if (drawit && sample.frame_count % num_count == num_count - 1) {
- XRectangle rect = { 0, 0, width, height };
+ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
draw (rect);
}

View File

@ -0,0 +1,29 @@
--- src/control.cc.orig 2018-01-19 00:48:36 UTC
+++ src/control.cc
@@ -566,7 +566,7 @@ analyser_callback (Widget, XtPointer client_data, XtPo
XtWindow (analyser_drawing_w[n]));
XExposeEvent* e = (XExposeEvent*) c->event;
- XRectangle rect = { e->x, e->y, e->width, e->height };
+ XRectangle rect = { static_cast<short>(e->x), static_cast<short>(e->y), static_cast<unsigned short>(e->width), static_cast<unsigned short>(e->height) };
analyser[n].draw (rect);
} break;
@@ -585,7 +585,7 @@ analyser_callback (Widget, XtPointer client_data, XtPo
case ButtonPress:
case MotionNotify: {
XButtonPressedEvent* e = (XButtonPressedEvent*) c->event;
- XPoint point = { e->x, e->y };
+ XPoint point = { static_cast<short>(e->x),static_cast<short>(e->y) };
analyser[0].set_marker (point.x);
analyser[1].set_marker (point.x);
@@ -709,7 +709,7 @@ scope_callback (Widget, XtPointer, XtPointer call_data
scope.realize (XtDisplay (scope_drawing_w), XtWindow (scope_drawing_w));
XExposeEvent* e = (XExposeEvent*) c->event;
- XRectangle rect = { e->x, e->y, e->width, e->height };
+ XRectangle rect = { static_cast<short>(e->x),static_cast<short>(e->y), static_cast<unsigned short>(e->width), static_cast<unsigned short>(e->height) };
scope.draw (rect);
} break;

View File

@ -1,3 +0,0 @@
bin/xanalyser
lib/X11/app-defaults/XAnalyser
man/man1/xanalyser.1.gz