apimall / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

Change CefListValue API to use size_t type for index values #1491

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I get such warnings:

    v8utils.cpp(40) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data

The code is:

    listValue->SetNull(listValue->GetSize());

The problem is that GetSize() returns size_t, while SetXxxx() functions expect 
int:

    virtual bool SetNull(int index) =0;
    virtual size_t GetSize() =0;

Using Windows7 64bit.
Compiling using VS2008 for x64 platform.

Original issue reported on code.google.com by czarek.t...@gmail.com on 16 Jan 2015 at 1:13

GoogleCodeExporter commented 9 years ago
There are more functions that accept int index. SetNull is just one of them:

  virtual bool SetNull(int index) =0;
  virtual bool SetBool(int index, bool value) =0;
  virtual bool SetInt(int index, int value) =0;
  virtual bool SetDouble(int index, double value) =0;
  virtual bool SetString(int index, const CefString& value) =0;
  ...

Original comment by czarek.t...@gmail.com on 16 Jan 2015 at 1:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sounds like you're using an old CEF version. Newer CEF versions build fine 
using VS2013 and targeting the x64 platform.

Original comment by magreenb...@gmail.com on 20 Jan 2015 at 7:21

GoogleCodeExporter commented 9 years ago
I don't think you understand the issue. It's not a build issue. This is an 
issue with API in some usage scenarios. It's explained in comment #0. All 
SetXxxx() functions should have size_t as index to be compatible with the 
GetSize() method. Or change the return value of GetSize() to int. Conversions 
from size_t to int will always generate warnings on x64 platform, even in 
VS2013 and with latest CEF versions.

Original comment by czarek.t...@gmail.com on 28 Jan 2015 at 8:48

GoogleCodeExporter commented 9 years ago
@#4: Thanks for the clarification. The API should use size_t instead of int for 
index values. Patches against trunk are welcome.

Original comment by magreenb...@gmail.com on 28 Jan 2015 at 9:14

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/1491

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:36