patch-formatter_cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. $OpenBSD: patch-formatter_cpp,v 1.1 2010/06/06 12:26:55 kili Exp $
  2. --- formatter.cpp.orig Sun Aug 14 04:40:58 2005
  3. +++ formatter.cpp Sat Jun 5 13:04:52 2010
  4. @@ -58,7 +58,7 @@ Formatter::Formatter(unsigned char *data, int offset)
  5. if ((c.type == INT_ARG) || (c.type == STRING_ARG) ||
  6. (c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG))
  7. {
  8. - int no = (int)c.data;
  9. + long no = (long)c.data;
  10. args[no - 1] = c.type;
  11. }
  12. }
  13. @@ -123,7 +123,7 @@ class StrArgValue: public ArgValue
  14. std::wstring Formatter::format(std::vector<ArgValue*> &argValues) const
  15. {
  16. std::wstring s;
  17. - int no;
  18. + long no;
  19. for (int i = 0; i < commandsCnt; i++) {
  20. Command *cmd = &commands[i];
  21. @@ -135,8 +135,8 @@ std::wstring Formatter::format(std::vector<ArgValue*>
  22. case STRING_ARG:
  23. case INT_ARG:
  24. - no = (int)cmd->data - 1;
  25. - if (no < (int)argValues.size())
  26. + no = (long)cmd->data - 1;
  27. + if (no < (long)argValues.size())
  28. s += argValues[no]->format(cmd);
  29. break;