Skip to main content
Inspiring
July 1, 2014
Question

long to int32 conversion issues in Xcode 5.0.2 when building plugin for Indesign CC 2014

  • July 1, 2014
  • 1 reply
  • 724 views

Hi, I am trying to build one of the sample plugin WriteFishPrice from the SDK on mac System

I am using Xcode 5.0.2 as per the documentation, but I am encountering the below errors during compilation.

In UnicodeSavvyString.h

template <class FwdIterator>

inline void UnicodeSavvyString::assign_impl(FwdIterator b, FwdIterator e, size_type nCodePoints, std::forward_iterator_tag)

{

  const difference_type nCodeValues = std::distance(b, e);

  ASSERT(nCodeValues >= 0);

// Make room for the chars

  code_value* buffer = GetBufferForWriting(nCodeValues);  // <----Implicit conversion loses integer precision long to int

// Copy them into the buffer

  std::copy(b, e, buffer);

// Ensure terminating null

  buffer[nCodeValues] = code_value();

  fUTF16BufferLength = nCodeValues;                         // <----Implicit conversion loses integer precision long to int

// Calculate how many code points we will have at the end

  if (nCodePoints == 0 && nCodeValues)

  {

  fNumChars = CountCharsUtil(buffer, nCodeValues);          // <----Implicit conversion loses integer precision long to int

         

  }

else

  {

  ASSERT((size_type)CountCharsUtil(buffer, nCodeValues) == nCodePoints);

  fNumChars = nCodePoints;

  }

}

And similar errors are coming in WideString.h.

Can some one tell me what is wrong with the new SDK? Or if I need to make some changes in these files which surely is not advisable.

This topic has been closed for replies.

1 reply

Inspiring
July 2, 2014

Hi kapoor_aman27,

this is just a warning, because the size of the string is stored as an int32 and some function has Argument with type int32. You can change the compiler setting "Treat Warnings as Errors" to "No". Then it is only a warning and you can ignore it as long as you use string with less than 4GB.

Markus