FreeBSD Bugzilla – Attachment 143316 Details for
Bug 190549
New port: comms/lysdr Lysdr SDR program for Unix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
comms/lysdr port
lysdr.shar (text/plain), 17.87 KB, created by
Stephen Hurd
on 2014-06-03 05:15:04 UTC
(
hide
)
Description:
comms/lysdr port
Filename:
MIME Type:
Creator:
Stephen Hurd
Created:
2014-06-03 05:15:04 UTC
Size:
17.87 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># lysdr ># lysdr/Makefile ># lysdr/distinfo ># lysdr/pkg-descr ># lysdr/files ># lysdr/files/patch-lysdr.c ># lysdr/files/Makefile ># lysdr/files/patch-audio_jack.c ># lysdr/files/patch-filter.c ># lysdr/files/patch-sdr.c ># lysdr/files/patch-filter.h ># lysdr/files/patch-sdr.h ># lysdr/files/patch-waterfall.c ># lysdr/files/patch-waterfall.h ># lysdr/files/patch-smeter.c ># lysdr/files/patch-smeter.h ># lysdr/files/patch-gui.c ># lysdr/files/cexp.c ># >echo c - lysdr >mkdir -p lysdr > /dev/null 2>&1 >echo x - lysdr/Makefile >sed 's/^X//' >lysdr/Makefile << '48be1ba320ca08e9aed0589329c92f09' >X# $FreeBSD$ >X >XPORTNAME= lysdr >XPORTVERSION= 0.0.6 >XCATEGORIES= comms hamradio >XMASTER_SITES= GH >X >XMAINTAINER= shurd@sasktel.net >XCOMMENT= Lysdr SDR program for Unix >X >XLICENSE= GPLv2 >X >XLIB_DEPENDS= libfftw3.so:${PORTSDIR}/math/fftw3 \ >X libjack.so:${PORTSDIR}/audio/jack >X >XWRKSRC= ${WRKDIR}/gordonjcp-lysdr-46d31fe >XUSE_GITHUB= yes >XGH_ACCOUNT= gordonjcp >XGH_COMMIT= 46d31fe >XGH_TAGNAME= stable-0 >X >XUSES= pkgconfig >XUSE_GNOME= gtk20 >XPLIST_FILES= bin/lysdr >X >Xpost-patch: >X ${CP} ${FILESDIR}/Makefile ${WRKSRC} >X ${CP} ${FILESDIR}/cexp.c ${WRKSRC} >X >Xdo-install: >X @${INSTALL_PROGRAM} ${WRKSRC}/lysdr ${STAGEDIR}${PREFIX}/bin/lysdr >X >X.include <bsd.port.mk> >48be1ba320ca08e9aed0589329c92f09 >echo x - lysdr/distinfo >sed 's/^X//' >lysdr/distinfo << '06de1fcb4ac9a4a0467993e89664346c' >XSHA256 (lysdr-0.0.6.tar.gz) = 747b04f0306a3258a02a41a208373a9f0e4c7a59c0c6215ac037c3b76d4e5969 >XSIZE (lysdr-0.0.6.tar.gz) = 109559 >06de1fcb4ac9a4a0467993e89664346c >echo x - lysdr/pkg-descr >sed 's/^X//' >lysdr/pkg-descr << '85f111b0848c9fe09d7f4d782e54c417' >Xlysdr, is a simple SDR program for amateur radio. >X >XWWW: https://github.com/gordonjcp/lysdr >85f111b0848c9fe09d7f4d782e54c417 >echo c - lysdr/files >mkdir -p lysdr/files > /dev/null 2>&1 >echo x - lysdr/files/patch-lysdr.c >sed 's/^X//' >lysdr/files/patch-lysdr.c << '1b6a6b6d7b50a61a72c3fec90357a7e6' >X--- lysdr.c.orig 2014-06-02 01:02:06.000000000 -0700 >X+++ lysdr.c 2014-06-02 01:02:18.000000000 -0700 >X@@ -103,10 +103,6 @@ >X >X printf("lysdr starting\n"); >X >X- // get the Gtk threads support going >X- if(!g_thread_supported()) >X- g_thread_init(NULL); >X- >X gdk_threads_init(); >X gdk_threads_enter(); >X >1b6a6b6d7b50a61a72c3fec90357a7e6 >echo x - lysdr/files/Makefile >sed 's/^X//' >lysdr/files/Makefile << 'f14cea7003154971ea815d651c818b80' >X# Makefile based on wscript >X# waf does deep magic ignoring our environment. >X >XPACKAGES= gtk+-2.0 jack fftw3 >XCFLAGS+= `pkg-config -cflags ${PACKAGES}` >XLDFLAGS+= `pkg-config -libs ${PACKAGES}` -lm >X >XSRCS= gui.c sdr.c filter.c audio_jack.c smeter.c waterfall.c lysdr.c >X.if ${OSVERSION} < 900000 >XSRCS+= cexp.c >X.endif >XPROG= lysdr >XWITHOUT_MAN= yes >X >X.include <bsd.prog.mk> >f14cea7003154971ea815d651c818b80 >echo x - lysdr/files/patch-audio_jack.c >sed 's/^X//' >lysdr/files/patch-audio_jack.c << '6635b117f3f1997f44cc61f46e1bbaac' >X--- audio_jack.c.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ audio_jack.c 2014-06-02 02:37:35.000000000 -0700 >X@@ -93,8 +93,9 @@ >X // save some info in the SDR >X sdr->size = jack_get_buffer_size(client); >X sdr->sample_rate = jack_get_sample_rate(client); >X- sdr->iqSample = g_new0(complex, sdr->size); >X+ sdr->iqSample = g_new0(complex double, sdr->size); >X sdr->output = g_new0(double, sdr->size); >X+ return 0; >X } >X >X int audio_stop(sdr_data_t *sdr) { >X@@ -104,6 +105,7 @@ >X if (sdr->iqSample) g_free(sdr->iqSample); >X if (sdr->output) g_free(sdr->output); >X >X+ return 0; >X } >X >X int audio_connect(sdr_data_t *sdr, gboolean ci, gboolean co) { >X@@ -163,6 +165,7 @@ >X } >X free(ports); >X } >X+ return 0; >X } >X >X /* vim: set noexpandtab ai ts=4 sw=4 tw=4: */ >6635b117f3f1997f44cc61f46e1bbaac >echo x - lysdr/files/patch-filter.c >sed 's/^X//' >lysdr/files/patch-filter.c << '452fe3558efc02e619dbca7c7373eef6' >X--- filter.c.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ filter.c 2014-06-02 03:50:20.000000000 -0700 >X@@ -22,16 +22,19 @@ >X #include <stdlib.h> >X #include <complex.h> >X #include <math.h> >X+ >X+double complex cexp(double complex z); >X+ >X #include "filter.h" >X #include "sdr.h" >X >X #define IS_ALMOST_DENORMAL(f) (fabs(f) < 3.e-34) >X >X-static void make_impulse(complex fir_imp[], float sample_rate, int taps, float bw, float centre) { >X+static void make_impulse(complex double fir_imp[], float sample_rate, int taps, float bw, float centre) { >X >X float K = bw * taps / sample_rate; >X float w; >X- complex z; >X+ complex double z; >X int k, i=0; >X >X float tune = 2.0 * M_PI * centre / sample_rate; >X@@ -57,7 +60,7 @@ >X filter_fir_t *filter = malloc(sizeof(filter_fir_t)); >X filter->taps = taps; >X filter->size = size; >X- filter->impulse = malloc(sizeof(complex)*taps); >X+ filter->impulse = malloc(sizeof(complex double)*taps); >X filter->imp_I = malloc(sizeof(double)*taps); >X filter->imp_Q = malloc(sizeof(double)*taps); >X filter->buf_I = malloc(sizeof(double)*taps); >X@@ -89,11 +92,11 @@ >X } >X } >X >X-void filter_fir_process(filter_fir_t *filter, complex *samples) { >X+void filter_fir_process(filter_fir_t *filter, complex double *samples) { >X // Perform an FIR filter on the data "in place" >X // this routine is slow and has a horrible hack to avoid denormals >X int i, j, k; >X- complex c; >X+ complex double c; >X double accI, accQ; >X double *buf_I = filter->buf_I; >X double *buf_Q = filter->buf_Q; >452fe3558efc02e619dbca7c7373eef6 >echo x - lysdr/files/patch-sdr.c >sed 's/^X//' >lysdr/files/patch-sdr.c << 'bf6c01ede93396f67c1919025d8d48b1' >X--- sdr.c.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ sdr.c 2014-06-02 03:45:08.000000000 -0700 >X@@ -26,6 +26,8 @@ >X #include <fftw3.h> >X #include <string.h> >X >X+double complex cexp(double complex z); >X+ >X #include "filter.h" >X #include "sdr.h" >X >X@@ -56,7 +58,7 @@ >X // actually do the SDR bit >X int i, j, k; >X double y, accI, accQ; >X- complex c; >X+ complex double c; >X fft_data_t *fft = sdr->fft; >X int size = sdr->size; >X int block_size = MIN(size, FFT_SIZE); // ensure we don't try to copy a block larger than FFT_SIZE >X@@ -73,8 +75,8 @@ >X >X // copy this period to FFT buffer, or as much as will fit >X // note that if the jack periodsize is greater than FFT_LEN, it will only copy FFT_LEN samples >X- memmove(fft->samples, fft->samples+block_size, sizeof(complex)*(FFT_SIZE-block_size)); // move the last lot up >X- memmove(fft->samples+FFT_SIZE-block_size, sdr->iqSample, sizeof(complex)*block_size); // copy the current block >X+ memmove(fft->samples, fft->samples+block_size, sizeof(complex double)*(FFT_SIZE-block_size)); // move the last lot up >X+ memmove(fft->samples+FFT_SIZE-block_size, sdr->iqSample, sizeof(complex double)*block_size); // copy the current block >X >X >X // shift frequency >X@@ -123,6 +125,7 @@ >X } >X break; >X } >X+ return 0; >X } >X >X void fft_setup(sdr_data_t *sdr) { >bf6c01ede93396f67c1919025d8d48b1 >echo x - lysdr/files/patch-filter.h >sed 's/^X//' >lysdr/files/patch-filter.h << 'fd67361083938f64bdd37ebcf3f8f131' >X--- filter.h.orig 2014-06-02 02:18:30.000000000 -0700 >X+++ filter.h 2014-06-02 02:18:39.000000000 -0700 >X@@ -30,7 +30,7 @@ >X >X // FIR filter defs >X typedef struct { >X- complex *impulse; >X+ complex double *impulse; >X double *buf_I; >X double *buf_Q; >X double *imp_I; >X@@ -43,7 +43,7 @@ >X filter_fir_t *filter_fir_new(int taps, int size); >X void filter_fir_destroy(filter_fir_t *filter); >X void filter_fir_set_response(filter_fir_t *filter, int sample_rate, float bw, float centre); >X-void filter_fir_process(filter_fir_t *filter, complex *samples); >X+void filter_fir_process(filter_fir_t *filter, complex double *samples); >X #endif >X >X /* vim: set noexpandtab ai ts=4 sw=4 tw=4: */ >fd67361083938f64bdd37ebcf3f8f131 >echo x - lysdr/files/patch-sdr.h >sed 's/^X//' >lysdr/files/patch-sdr.h << 'd9f028ccd5d399c8cffd4708836f0898' >X--- sdr.h.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ sdr.h 2014-06-02 02:33:44.000000000 -0700 >X@@ -46,9 +46,9 @@ >X } fft_data_t; >X >X typedef struct { >X- complex *iqSample; // the array of incoming samples >X- complex loVector; // local oscillator vector >X- complex loPhase; // local oscillator phase angle (sets tuning) >X+ complex double *iqSample; // the array of incoming samples >X+ complex double loVector; // local oscillator vector >X+ complex double loPhase; // local oscillator phase angle (sets tuning) >X gdouble *output; // pointer to output samples >X >X GtkObject *tuning; // adjustment for tuning >X@@ -63,7 +63,7 @@ >X filter_fir_t *filter; >X >X // things to keep track of between callbacks >X- complex dc_remove; >X+ complex double dc_remove; >X gfloat agc_gain; >X gfloat agc_speed; >X // jack parameters >X@@ -74,6 +74,9 @@ >X >X sdr_data_t *sdr_new(); >X int sdr_process(sdr_data_t *sdr); >X+void sdr_destroy(sdr_data_t *sdr); >X+void fft_setup(sdr_data_t *sdr); >X+void fft_teardown(sdr_data_t *sdr); >X #endif >X >X /* vim: set noexpandtab ai ts=4 sw=4 tw=4: */ >d9f028ccd5d399c8cffd4708836f0898 >echo x - lysdr/files/patch-waterfall.c >sed 's/^X//' >lysdr/files/patch-waterfall.c << '92e803026e32bd48180b714041be5289' >X--- waterfall.c.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ waterfall.c 2014-06-02 03:12:20.000000000 -0700 >X@@ -21,6 +21,7 @@ >X */ >X >X #include <math.h> >X+#include <stdlib.h> >X #include <string.h> >X >X #include <gtk/gtk.h> >X@@ -38,8 +39,6 @@ >X static void sdr_waterfall_realize(GtkWidget *widget); >X static void sdr_waterfall_unrealize(GtkWidget *widget); >X static void sdr_waterfall_draw_scale(GtkWidget *widget); >X-void sdr_waterfall_set_lowpass(SDRWaterfall *wf, gdouble value); >X-void sdr_waterfall_set_highpass(SDRWaterfall *wf, gdouble value); >X >X static void sdr_waterfall_class_init (SDRWaterfallClass *class) { >X GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class); >X@@ -132,8 +131,7 @@ >X >X sdr_waterfall_set_scale(widget, wf->centre_freq); >X >X- g_assert(priv->mutex == NULL); >X- priv->mutex = g_mutex_new(); >X+ g_mutex_init(&priv->mutex); >X gtk_adjustment_value_changed(wf->tuning); >X } >X >X@@ -146,7 +144,7 @@ >X if (wf->scale) // we might not have a scale >X g_object_unref(wf->scale); >X >X- g_mutex_free(priv->mutex); >X+ g_mutex_clear(&priv->mutex); >X GTK_WIDGET_CLASS(parent_class)->unrealize(widget); >X } >X >X@@ -184,7 +182,7 @@ >X gtk_widget_queue_draw(GTK_WIDGET(wf)); >X } >X >X-GtkWidget *sdr_waterfall_new(GtkAdjustment *tuning, GtkAdjustment *lp_tune, GtkAdjustment *hp_tune, gint sample_rate, gint fft_size) { >X+SDRWaterfall *sdr_waterfall_new(GtkAdjustment *tuning, GtkAdjustment *lp_tune, GtkAdjustment *hp_tune, gint sample_rate, gint fft_size) { >X // call this with three Adjustments, for tuning, lowpass filter and highpass filter >X // the tuning Adjustment should have its upper and lower bounds set to half the sample rate >X SDRWaterfall *wf; >X@@ -209,7 +207,7 @@ >X G_CALLBACK (sdr_waterfall_lowpass_changed), wf); >X g_signal_connect (hp_tune, "value-changed", >X G_CALLBACK (sdr_waterfall_highpass_changed), wf); >X- return GTK_WIDGET(wf); >X+ return wf; >X >X } >X >X@@ -328,6 +326,7 @@ >X gtk_widget_queue_draw(widget); >X priv->prelight = prelight; >X } >X+ return TRUE; >X } >X >X static gboolean sdr_waterfall_button_press(GtkWidget *widget, GdkEventButton *event) { >X@@ -358,6 +357,7 @@ >X gtk_widget_queue_draw(widget); >X break; >X } >X+ return TRUE; >X } >X >X static gboolean sdr_waterfall_button_release(GtkWidget *widget, GdkEventButton *event) { >X@@ -392,6 +392,8 @@ >X case GDK_SCROLL_DOWN: >X tuning += step; >X break; >X+ default: >X+ break; >X } >X >X sdr_waterfall_set_tuning(wf, tuning); >X@@ -418,12 +420,12 @@ >X cairo_rectangle(cr, 0, 0, width, height); >X cairo_clip(cr); >X >X- g_mutex_lock(priv->mutex); >X+ g_mutex_lock(&priv->mutex); >X gdk_cairo_set_source_pixmap(cr, wf->pixmap, 0, -priv->scroll_pos); >X cairo_paint(cr); >X gdk_cairo_set_source_pixmap(cr, wf->pixmap, 0, height-priv->scroll_pos); >X cairo_paint(cr); >X- g_mutex_unlock(priv->mutex); >X+ g_mutex_unlock(&priv->mutex); >X >X // cursor is translucent when "off", opaque when prelit >X cursor = priv->cursor_pos; >X@@ -486,10 +488,10 @@ >X (4*wf->fft_size) >X ); >X >X- g_mutex_lock(priv->mutex); >X+ g_mutex_lock(&priv->mutex); >X cairo_set_source_surface (cr, s_row, 0, priv->scroll_pos); >X cairo_paint(cr); >X- g_mutex_unlock(priv->mutex); >X+ g_mutex_unlock(&priv->mutex); >X >X priv->scroll_pos++; >X if (priv->scroll_pos >= wf->wf_height) priv->scroll_pos = 0; >92e803026e32bd48180b714041be5289 >echo x - lysdr/files/patch-waterfall.h >sed 's/^X//' >lysdr/files/patch-waterfall.h << 'fd735210699ad6c396e1c4c6e34216af' >X--- waterfall.h.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ waterfall.h 2014-06-02 03:08:41.000000000 -0700 >X@@ -74,7 +74,7 @@ >X gint drag; >X gint click_pos; >X gdouble bandspread; >X- GMutex *mutex; >X+ GMutex mutex; >X }; >X >X #define SDR_TYPE_WATERFALL (sdr_waterfall_get_type ()) >X@@ -93,7 +93,7 @@ >X #define SCALE_HEIGHT 24 >X #define SCALE_TICK 5000 >X >X-GtkWidget *sdr_waterfall_new(GtkAdjustment *tuning, GtkAdjustment *lp_tune, GtkAdjustment *hp_tune, gint sample_rate, gint fft_size); >X+SDRWaterfall *sdr_waterfall_new(GtkAdjustment *tuning, GtkAdjustment *lp_tune, GtkAdjustment *hp_tune, gint sample_rate, gint fft_size); >X float sdr_waterfall_get_tuning(SDRWaterfall *wf); >X float sdr_waterfall_get_lowpass(SDRWaterfall *wf); >X float sdr_waterfall_get_highpass(SDRWaterfall *wf); >X@@ -102,6 +102,9 @@ >X void sdr_waterfall_update(GtkWidget *widget, guchar *row); >X void sdr_waterfall_set_scale(GtkWidget *widget, gint centre_freq); >X void sdr_waterfall_filter_cursors(SDRWaterfall *wf); >X+void sdr_waterfall_set_lowpass(SDRWaterfall *wf, gdouble value); >X+void sdr_waterfall_set_highpass(SDRWaterfall *wf, gdouble value); >X+GType sdr_waterfall_get_type(void); >X #endif /* __WATERFALL_H */ >X >X /* vim: set noexpandtab ai ts=4 sw=4 tw=4: */ >fd735210699ad6c396e1c4c6e34216af >echo x - lysdr/files/patch-smeter.c >sed 's/^X//' >lysdr/files/patch-smeter.c << 'ac64080abfc8f5b3a44b035236c0ca17' >X--- smeter.c.orig 2014-06-02 02:39:40.000000000 -0700 >X+++ smeter.c 2014-06-02 02:40:19.000000000 -0700 >X@@ -85,6 +85,7 @@ >X cairo_fill(cr); >X >X cairo_destroy(cr); >X+ return TRUE; >X } >X >X void sdr_smeter_set_level(SDRSMeter *sm, gdouble level) { >ac64080abfc8f5b3a44b035236c0ca17 >echo x - lysdr/files/patch-smeter.h >sed 's/^X//' >lysdr/files/patch-smeter.h << 'ed3455bf60ff1a98bf7cec7e82f92a5a' >X--- smeter.h.orig 2014-06-02 02:51:37.000000000 -0700 >X+++ smeter.h 2014-06-02 02:51:54.000000000 -0700 >X@@ -55,6 +55,7 @@ >X >X GtkWidget *sdr_smeter_new(); >X void sdr_smeter_set_level(SDRSMeter *sm, gdouble value); >X+GType sdr_smeter_get_type(void); >X >X #endif /* __SMETER_H */ >X >ed3455bf60ff1a98bf7cec7e82f92a5a >echo x - lysdr/files/patch-gui.c >sed 's/^X//' >lysdr/files/patch-gui.c << '9b243d4810bf925ec86d1fdcaadb6f05' >X--- gui.c.orig 2011-11-26 16:01:22.000000000 -0800 >X+++ gui.c 2014-06-02 03:45:03.000000000 -0700 >X@@ -23,6 +23,8 @@ >X #include <complex.h> >X #include <gtk/gtk.h> >X >X+double complex cexp(double complex z); >X+ >X #include "sdr.h" >X #include "waterfall.h" >X #include "smeter.h" >X@@ -31,7 +33,7 @@ >X >X // these are global so that the gui_update routine can fiddle with them >X static GtkWidget *label; >X-static GtkWidget *wfdisplay; >X+static SDRWaterfall *wfdisplay; >X static GtkWidget *meter; >X >X /* >X@@ -215,8 +217,8 @@ >X // 20m = 14075000 >X // 15m = 21045000 >X SDR_WATERFALL(wfdisplay)->centre_freq = sdr->centre_freq; >X- gtk_widget_set_size_request(wfdisplay, FFT_SIZE, 250); >X- gtk_box_pack_start(GTK_BOX(vbox), wfdisplay, TRUE, TRUE, 0); >X+ gtk_widget_set_size_request(GTK_WIDGET(wfdisplay), FFT_SIZE, 250); >X+ gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(wfdisplay), TRUE, TRUE, 0); >X gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); >X >X gtk_widget_show_all(mainWindow); >9b243d4810bf925ec86d1fdcaadb6f05 >echo x - lysdr/files/cexp.c >sed 's/^X//' >lysdr/files/cexp.c << '9bc9c2a8b0d50013bc83a3b9cab7f534' >X/* $NetBSD: cexp.c,v 1.1 2007/08/20 16:01:34 drochner Exp $ */ >X >X/*- >X * Copyright (c) 2007 The NetBSD Foundation, Inc. >X * All rights reserved. >X * >X * This code is derived from software written by Stephen L. Moshier. >X * It is redistributed by the NetBSD Foundation by permission of the author. >X * >X * Redistribution and use in source and binary forms, with or without >X * modification, are permitted provided that the following conditions >X * are met: >X * 1. Redistributions of source code must retain the above copyright >X * notice, this list of conditions and the following disclaimer. >X * 2. Redistributions in binary form must reproduce the above copyright >X * notice, this list of conditions and the following disclaimer in the >X * documentation and/or other materials provided with the distribution. >X * >X * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS >X * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED >X * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >X * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS >X * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >X * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >X * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >X * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >X * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >X * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE >X * POSSIBILITY OF SUCH DAMAGE. >X */ >X >X#include <complex.h> >X#include <math.h> >X >Xdouble complex >Xcexp(double complex z) >X{ >X double complex w; >X double r, x, y; >X >X x = creal(z); >X y = cimag(z); >X r = exp(x); >X w = r * cos(y) + r * sin(y) * I; >X return w; >X} >9bc9c2a8b0d50013bc83a3b9cab7f534 >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 190549
: 143316