<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Rebonjour,<br>
Désolé je viens de voir mon erreur, elle est située dans le fichier
C,<br>
le calcul de la taille est mauvais.<br>
<br>
Cordialement,<br>
<div class="moz-cite-prefix">Le 14/09/2014 12:05, khairy mehdi a
écrit :<br>
</div>
<blockquote cite="mid:54156875.6080606@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Bonjour,<br>
Je cherche à retourner un tableau d'int depuis une fonction C,<br>
mais malgré les exemples le tableau retourné ne contient que des<br>
valeurs qui semblent incohérentes.<br>
<br>
Peut-être pourrez vous voir ce que je rate.<br>
<br>
Merci.<br>
<br>
<small><small><small>void LFSR( int seq[], int * stage, int *
taps, int * start_value) {<br>
int size;<br>
int lfsr;<br>
int i;<br>
size = (2^(*stage))-1;<br>
lfsr = *start_value;<br>
<br>
for(i = 0; i < size; i++) {<br>
seq[i] = 1;<br>
}<br>
}<br>
</small></small></small><br>
=================================================<br>
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(174,92,176);text-decoration:underline;">ilib_for_link</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">LFSR</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">lfsr.c</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">c</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">exec</span> <span style="color:rgb(188,143,143);">loader.sce</span>
<span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">PRN</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);text-decoration:underline;">LFSR</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">stage</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">taps</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">init_value</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">seq_size</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">2</span><span style="color:rgb(92,92,92);">^</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">stage</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">-</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">seq</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">call</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">LFSR</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">stage</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">2</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">taps</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">3</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(1
88,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">init_value</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">4</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">out</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">seq_size</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb
(
0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(131,67,16);font-weight:bold;">PRN</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);">seq</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(176,24,19);">endfunction</span></pre>
<br>
</blockquote>
<br>
</body>
</html>