Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(19)

Issue 103: Fix add location method in CPO

Unified Diff

File: translate/storage/cpo.py
Patch Set: Created 1 year, 3 months ago
Jump to:
View side by-side-diff with in line comments
« no previous file | no next file »
Index: translate/storage/cpo.py
===================================================================
--- translate/storage/cpo.py	(revision 8228)
+++ translate/storage/cpo.py	(working copy)
@@ -120,7 +120,7 @@
 gpo.po_filepos_file.restype = STRING
 gpo.po_message_filepos.restype = c_int
 gpo.po_message_filepos.argtypes = [c_int, c_int]
-gpo.po_message_add_filepos.argtypes = [c_int, STRING, c_int]
+gpo.po_message_add_filepos.argtypes = [c_int, STRING, c_size_t]
 
 # Message (get methods)
 gpo.po_message_comments.restype = STRING
@@ -502,7 +502,9 @@
             if len(parts) == 2:
                 line = int(parts[1])
             else:
-                line = -1
+                # libgettextpo requires a (size_t)(-1) if no file
+                # location is available
+                line = c_size_t(-1)
             gpo.po_message_add_filepos(self._gpo_message, file, line)
 
     def getcontext(self):

« no previous file | no next file »

Powered by Google App Engine
This is Rietveld r159