Skip to contentSkip to conversation

: [PATCH] pcm_dmix.c:92: error: static declaration of 'shm_sum_discard' follows non-static declaration

ALSA - lib 0001005 [email protected] 1 participant 1 message Mar 22, 2005

lore
Share & tools
lore
#0 lore raw

The following issue has been RESOLVED.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1005>
======================================================================

Reported By:                jdthood
Assigned To:                tiwai
======================================================================
Project:                    ALSA - lib
Issue ID:                   1005
Category:                   general
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             03-22-2005 09:03 CET
Last Modified:              03-22-2005 19:49 CET

======================================================================
Summary: [PATCH] pcm_dmix.c:92: error: static declaration of
'shm_sum_discard' follows non-static declaration
Description:
http://bugs.debian.org/300792

-------- Forwarded Message --------
From: Andreas Jochens <[email protected]>
Reply-To: Andreas Jochens <[email protected]>, [email protected]
To: Debian Bug Tracking System <[email protected]>
Subject: [Pkg-alsa-devel] Bug#300792: alsa-lib: FTBFS (ppc64/gcc-4.0):
static declaration of 'shm_sum_discard' follows non-static declaration
Date: Mon, 21 Mar 2005 22:42:00 +0100
Package: alsa-lib
Severity: normal
Tags: patch

When building 'alsa-lib' on ppc64 with gcc-4.0,
I get the following error:

pcm_dmix.c: At top level:
pcm_dmix.c:92: error: static declaration of 'shm_sum_discard' follows non-static declaration
pcm_dmix.c:84: error: previous implicit declaration of 'shm_sum_discard' was here
pcm_dmix.c:221:2: warning: #warning Please, recode mix_areas1() routine to your architecture...
pcm_dmix.c: In function 'mix_areas1':
pcm_dmix.c:247: error: invalid lvalue in assignment pcm_dmix.c:248: error: invalid lvalue in assignment pcm_dmix.c:249: error: invalid lvalue in assignment pcm_dmix.c:253:2: warning: #warning Please, recode mix_areas2() routine to your architecture...
pcm_dmix.c: In function 'mix_areas2':
pcm_dmix.c:279: error: invalid lvalue in assignment pcm_dmix.c:280: error: invalid lvalue in assignment pcm_dmix.c:281: error: invalid lvalue in assignment
make[3]: *** [pcm_dmix.lo] Error 1
make[3]: Leaving directory `/alsa-lib-1.0.8/src/pcm'

With the attached patch 'alsa-lib' can be compiled on ppc64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/alsa-lib-1.0.8/src/conf.c ./src/conf.c
--- ../tmp-orig/alsa-lib-1.0.8/src/conf.c 2004-10-05 17:33:04.000000000
+0200
+++ ./src/conf.c 2005-03-21 22:30:08.619865849 +0100
@@ -2486,6 +2486,8 @@
snd_config_searcha, snd_config_searchva);
}

+static int snd_config_hooks(snd_config_t *config, snd_config_t *private_data);
+
/**
* \brief Searches for a node in a configuration tree and expands hooks.
* \param config Handle to the root of the configuration (sub)tree to
search.
@@ -2496,7 +2498,6 @@
*/
int snd_config_search_hooks(snd_config_t *config, const char *key,
snd_config_t **result)
{
- static int snd_config_hooks(snd_config_t *config, snd_config_t
*private_data);
SND_CONFIG_SEARCH(config, key, result, \
err = snd_config_hooks(config, NULL); \
if (err < 0) \
@@ -2504,6 +2505,8 @@
);
}

+static int snd_config_hooks(snd_config_t *config, snd_config_t *private_data);
+
/**
* \brief Searches for a node in a configuration tree, expanding aliases
and hooks.
* \param root Handle to the root configuration node containing alias
@@ -2516,7 +2519,6 @@
*/
int snd_config_searcha_hooks(snd_config_t *root, snd_config_t *config,
const char *key, snd_config_t **result)
{
- static int snd_config_hooks(snd_config_t *config, snd_config_t
*private_data);
SND_CONFIG_SEARCHA(root, config, key, result,
snd_config_searcha_hooks, err = snd_config_hooks(config, NULL); \
diff -urN ../tmp-orig/alsa-lib-1.0.8/src/pcm/pcm_dmix.c ./src/pcm/pcm_dmix.c
--- ../tmp-orig/alsa-lib-1.0.8/src/pcm/pcm_dmix.c 2005-01-11
18:42:49.000000000 +0100
+++ ./src/pcm/pcm_dmix.c 2005-03-21 22:07:17.000000000 +0100
@@ -53,12 +53,13 @@
*
*/

+static int shm_sum_discard(snd_pcm_direct_t *dmix); +
/*
* sum ring buffer shared memory area
*/
static int shm_sum_create_or_connect(snd_pcm_direct_t *dmix) {
- static int shm_sum_discard(snd_pcm_direct_t *dmix);
struct shmid_ds buf;
int tmpid, err;
size_t size;
@@ -244,9 +245,9 @@
} while (*sum != old_sample);
if (!--size)
return;
- ((char *)src) += src_step;
- ((char *)dst) += dst_step;
- ((char *)sum) += sum_step;
+ src = ((char *)src) + src_step;
+ dst = ((char *)dst) + dst_step;
+ sum = ((char *)sum) + sum_step;
}
}

@@ -276,9 +277,9 @@
} while (*sum != old_sample);
if (!--size)
return;
- ((char *)src) += src_step;
- ((char *)dst) += dst_step;
- ((char *)sum) += sum_step;
+ src = ((char *)src) + src_step;
+ dst = ((char *)dst) + dst_step;
+ sum = ((char *)sum) + sum_step;
}
}

======================================================================

----------------------------------------------------------------------
tiwai - 03-22-05 19:49
----------------------------------------------------------------------
Fixed on CVS.

Issue History
Date Modified Username Field Change
======================================================================

03-22-05 09:03 jdthood        New Issue                                    
03-22-05 19:49 tiwai          Status                   new => resolved     
03-22-05 19:49 tiwai          Resolution               open => fixed       
03-22-05 19:49 tiwai          Assigned To               => tiwai           
03-22-05 19:49 tiwai          Note Added: 0004129                          

======================================================================

-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click