freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Win64 issues and coding style


From: suzuki toshiya
Subject: [ft-devel] Win64 issues and coding style
Date: Thu, 28 Feb 2013 11:36:13 +0900
User-agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080406)

Dear Werner,

Sorry for my lated action to Win64 homework, now I'm working for...
During the fix work, I think about a possibility to improve the
coding style to clarify why some kludges (looking like unneeded)
are inserted. For example,

ft_internal_function(unsigned long  arg)
{
  ...
}

FT_Error
FT_Function(long int  arg)
{
  /*
   * public API takes signed arg,
   * but working function takes unsigned arg
   */
  if (arg < 0)
    return  FT_Err_Invalid_Argument;

  ft_internal_function((unsigned long) arg);
}

In such case, I want to write as:

ft_internal_function(unsigned long ularg)
{
  ...
}

FT_Error
FT_Function(long int  slarg)
{
   FT_Err         err;

  /*
   * public API takes signed arg,
   * but working function takes unsigned arg
   */
  if (slarg < 0)
    return  FT_Err_Invalid_Argument;

  ft_internal_function((unsigned long)slarg);
}

I guess, the requirement of such kludges are originally caused
by the unexpected mismatched types in public interface and the
internal procedure. Although we have to keep API compatibility,
it is expected that the mismatches would be removed in the future
version after incompatible big changes.

The purposes of my proposal is the clarification "from which
type to which type". The cast is for the sign matching? or for
the size matching?

If I put such changes to .c sources only, they would not bother
documentation. But the mismatched variable names between .h and
.c could be confusing for some developers. Werner, could you give
some comments?

Regards,
mpsuzuki



reply via email to

[Prev in Thread] Current Thread [Next in Thread]