On Fri, 7 Sep 2007, Magnus Myrefors wrote:
> By the way I have found out that I used a way of reading lines
> from the input-file which can cause some problem. I read in a
> book that fgets(string, sizeof(string), input) should read one
> line up to sizeof(string) -1 or to the first newline- ch
On Fri, Sep 07, 2007 at 05:02:37PM +0200, Magnus Myrefors wrote:
> By the way I have found out that I used
> a way of reading lines from the input-file which can cause
> some problem. I read in a book that fgets(string, sizeof(string), input)
> should read one line up to sizeof(string) -1 or to th
On Fri, 7 Sep 2007 16:16:35 +0200
Magnus Myrefors <[EMAIL PROTECTED]> wrote:
By the way I have found out that I used
a way of reading lines from the input-file which can cause
some problem. I read in a book that fgets(string, sizeof(string), input)
should read one line up to sizeof(string) -1 or t
I looked at the code and I as far as I also think
that something should be printed to stdout.
The only thing I could see in the code was that malloc
wasn't used to allocate char *buf in the args to function
getline().
Magnus
On Fri, 7 Sep 2007 10:08:19 +0200
David Nečas (Yeti) <[EMAIL PROTECTE
On Fri, Sep 07, 2007 at 01:45:09AM +0200, Magnus Myrefors wrote:
>
> yeti>> I have tested your minimal testprogram with the whole
> test-file. Unfortunately the program doesn't print anything to
> stdout. It doesn't seem to be any data stored in the GSList
> or in the datastructure, Data *data.
I
Jaja, so it wasn't crappy, it was **crap*.* :P
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
yeti>> I have tested your minimal testprogram with the whole
test-file. Unfortunately the program doesn't print anything to
stdout. It doesn't seem to be any data stored in the GSList
or in the datastructure, Data *data. (I tried to print a field
every time a new line was about to be read in the w
On Thu, Sep 06, 2007 at 11:00:11AM -0300, Matías Alejandro Torres wrote:
> Here's the minimal program to read that. The reading part is kind of
> crappy but it works with that example.
The trouble with the reading part is not that it's kind of
crappy (well, it is IMO, reading by character makes
Magnus Myrefors escribió:
> Hi,
> Ok, here's a small part of it. The whole file is about
> 2400 rows. I can read over approximately 95 % of it ok
> but the rest is somewhat corrupted. I think it is
> the function g_ascii_isdigit() that fails sometimes which
> leaves a uncompleted conversion. I a
On Tue, 4 Sep 2007, Magnus Myrefors wrote:
> I tested my code with valgrind and I got some error-messages
> that derived from my own code.I changed the code and then
> the error-messages disapperad. I still get wrong values that
> seem to occur randomly though...
As Yeti said, you should try wr
What's the input file like? Can you attach a part of it? If you do so, I
can make a try on reading it.
Matías
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
I managed to compile g_ascii_strtod() in my own code.
I obtain the same result though. I use another function
that I want to look how it is coded and it is the
function g_ascii_isdigit(). I have searced for it in
glib-2.12-9 but I didn't find it...
/Magnus
On Wed, 5 Sep 2007 00:47:36 +0200
David
On Tue, Sep 04, 2007 at 11:55:58PM +0200, Magnus Myrefors wrote:
>
> I tried with strtod() but it only worked with strings with no
> decimal-point, otherwise the resulting double was truncated.
> ...
> > - if the numbers are normal, i.e. supported by underlying
> > strtod(), try to use it direct
I tried with strtod() but it only worked with strings with no
decimal-point, otherwise the resulting double was truncated.
I also tried to copy g_ascii_strtod() (from glib-2.12-9) into
my code but it didn't compile and I didn't quite understand
the if-statement if(decimal_point_pos) {} where deci
On Tue, Sep 04, 2007 at 04:18:23PM +0200, Magnus Myrefors wrote:
>
> I tested my code with valgrind and I got some error-messages
> that derived from my own code.I changed the code and then
> the error-messages disapperad. I still get wrong values that
> seem to occur randomly though...
> Belo
I tested my code with valgrind and I got some error-messages
that derived from my own code.I changed the code and then
the error-messages disapperad. I still get wrong values that
seem to occur randomly though...
Below is the output from valgrind. It is the end of the
error-messages that were
On Tue, Sep 04, 2007 at 01:12:11AM +0200, Magnus Myrefors wrote:
>
> when I start the test I am in the same state
> and I use the same text-file evey time.
> The converted values can be different
> or the same between different test-runs so
> the wrong values seem to occur randomly.
Then try val
when I start the test I am in the same state
and I use the same text-file evey time.
The converted values can be different
or the same between different test-runs so
the wrong values seem to occur randomly.
Magnus
On Tue, 4 Sep 2007 00:26:28 +0200
David Nečas (Yeti) <[EMAIL PROTECTED]> wrote:
>
On Mon, Sep 03, 2007 at 08:46:51PM +0200, Magnus Myrefors wrote:
> I am currently trying to use the glib-functions g_ascii_strtod(x,y)
> and g_ascii_strtoll(x,y) to convert values from a text-file.
> It works fine most of the time but occasionally the converted values
> are absolutely wrong
Hi,
I am currently trying to use the glib-functions g_ascii_strtod(x,y)
and g_ascii_strtoll(x,y) to convert values from a text-file.
It works fine most of the time but occasionally the converted values
are absolutely wrong or just a bit wrong. I am using the glib
libraries (libglib2.0-dev
20 matches
Mail list logo