fixes #323
This commit is contained in:
parent
c445bd140a
commit
2782e88591
2 changed files with 23 additions and 2 deletions
|
|
@ -955,15 +955,22 @@ proc enumSpecifier(p: var TParser): PNode =
|
||||||
result = newNodeP(nkConstSection, p)
|
result = newNodeP(nkConstSection, p)
|
||||||
getTok(p, result)
|
getTok(p, result)
|
||||||
var i = 0
|
var i = 0
|
||||||
|
var hasUnknown = false
|
||||||
while true:
|
while true:
|
||||||
var name = skipIdentExport(p)
|
var name = skipIdentExport(p)
|
||||||
var val: PNode
|
var val: PNode
|
||||||
if p.tok.xkind == pxAsgn:
|
if p.tok.xkind == pxAsgn:
|
||||||
getTok(p, name)
|
getTok(p, name)
|
||||||
val = constantExpression(p)
|
val = constantExpression(p)
|
||||||
if val.kind == nkIntLit: i = int(val.intVal)+1
|
if val.kind == nkIntLit:
|
||||||
else: parMessage(p, errXExpected, "int literal")
|
i = int(val.intVal)+1
|
||||||
|
hasUnknown = false
|
||||||
|
else:
|
||||||
|
hasUnknown = true
|
||||||
else:
|
else:
|
||||||
|
if hasUnknown:
|
||||||
|
parMessage(p, warnUser, "computed const value may be wrong: " &
|
||||||
|
name.renderTree)
|
||||||
val = newIntNodeP(nkIntLit, i, p)
|
val = newIntNodeP(nkIntLit, i, p)
|
||||||
inc(i)
|
inc(i)
|
||||||
var c = createConst(name, ast.emptyNode, val, p)
|
var c = createConst(name, ast.emptyNode, val, p)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,20 @@ extern "C" {
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
/* 8bit, color or not */
|
||||||
|
CV_LOAD_IMAGE_UNCHANGED =-1,
|
||||||
|
/* 8bit, gray */
|
||||||
|
CV_LOAD_IMAGE_GRAYSCALE =0,
|
||||||
|
/* ?, color */
|
||||||
|
CV_LOAD_IMAGE_COLOR =1,
|
||||||
|
/* any depth, ? */
|
||||||
|
CV_LOAD_IMAGE_ANYDEPTH =2,
|
||||||
|
/* ?, any color */
|
||||||
|
CV_LOAD_IMAGE_ANYCOLOR =4
|
||||||
|
};
|
||||||
|
|
||||||
typedef void (*callback_t) (int rc);
|
typedef void (*callback_t) (int rc);
|
||||||
typedef const char* (*callback2)(int rc, long L, const char* buffer);
|
typedef const char* (*callback2)(int rc, long L, const char* buffer);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue