[Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9899 >
Benoit Hudson wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9899 >
>
> I've never seen python code before, but here's something that might work.
It looks right. However we should pay at least lip service to style and
have a few newlines with some indentation in there. Try this patch and
make sure it works.
jason
Index: common/generate_packets.py
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/generate_packets.py,v
retrieving revision 1.12
diff -u -r1.12 generate_packets.py
--- common/generate_packets.py 22 May 2004 11:37:40 -0000 1.12
+++ common/generate_packets.py 2 Sep 2004 05:15:31 -0000
@@ -432,7 +432,12 @@
if not self.is_array:
if self.struct_type=="bool":
return "dio_get_%(dataio_type)s(&din,
&real_packet->%(name)s);"%self.__dict__
- return "dio_get_%(dataio_type)s(&din, (int *)
&real_packet->%(name)s);"%self.__dict__
+ return '''{
+ int readin;
+
+ dio_get_%(dataio_type)s(&din, &readin);
+ real_packet->%(name)s = readin;
+}'''%self.__dict__
if self.is_struct:
c="dio_get_%(dataio_type)s(&din,
&real_packet->%(name)s[i]);"%self.__dict__
@@ -446,7 +451,12 @@
elif self.struct_type=="bool":
c="dio_get_%(dataio_type)s(&din,
&real_packet->%(name)s[i]);"%self.__dict__
else:
- c="dio_get_%(dataio_type)s(&din, (int *)
&real_packet->%(name)s[i]);"%self.__dict__
+ c='''{
+ int readin;
+
+ dio_get_%(dataio_type)s(&din, &readin);
+ real_packet->%(name)s[i] = readin;
+}'''%self.__dict__
if self.is_array==2:
array_size_u=self.array_size1_u
array_size_d=self.array_size1_d
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, (continued)
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/01
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Mike Kaufman, 2004/09/01
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/01
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Per I. Mathisen, 2004/09/01
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/01
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/01
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289,
Jason Short <=
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Gregory Berkolaiko, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Brett Albertson, 2004/09/02
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Brett Albertson, 2004/09/02
- [Freeciv-Dev] (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Jason Short, 2004/09/02
- [Freeciv-Dev] Re: (PR#9899) Assertion failed: cont > 0, file improvement.c, line 289, Benoit Hudson, 2004/09/02
|
|