私はこのtypedefを次のような構造体に使用しました
typedef struct { double x, y; } ACVector;
デバッガーでこのインスタンスを見ると、次のような非常に奇妙な出力が得られます。
(lldb) p _translation
(ACVector) $1 = {
(double) x = -5503.61
(double) y = -5503.61
(CLLocationDegrees) latitude = -5503.61
(CLLocationDegrees) longitude = -1315.67
}
(lldb) p _translation.x
(double) $2 = -5503.61
(lldb) p _translation.y
(double) $2 = -5503.61
ACVectorの定義をに変更した場合
typedef struct ACVector { double x, y; } ACVector;
デバッガーでも同じことをします。期待どおりの結果が得られます。
(lldb) p _translation
(ACVector) $1 = {
(double) x = -5503.61
(double) y = -1315.67
}
typedefに匿名構造体を使用することは合法です
OK、もっとコード
_translationの宣言はインスタンス変数として行われます
ACVector _translation;
この関数を使用して変数を初期化します
ACVector ACVectorMake( double x, double y )
{
ACVector r;
r.x = x;
r.y = y;
return r;
}
このような
_translation = ACVectorMake( d[xp[0]].x-s[xp[0]].x, d[xp[0]].y-s[xp[0]].y );
もともとは
ACVector ACVectorMake( double x, double y )
{
return (ACVector){x,y};
}
また、デバッガーの出力で緯度と経度の要素はどこから取得されますか。個別にアクセスすることはできません。
他の場所で定義されたACVectorに対応する詳細情報
私には2つの定義があります
#define ACVectorZero (ACVector){(double)0.0,(double)0.0}
#define ACVectorUnit (ACVector){(double)1.0,(double)1.0}
興味深いことに、これに直接続く
#define ACDegreesFromDegreesMinutesSeconds( d, m, s ) (CLLocationDegrees)(d+m/60.0+s/3600.0)
#define ACLocationFromDegreesMinutesSeconds( yd, ym, ys, xd, xm, xs ) (CLLocationCoordinate2D){ACDegreesFromDegreesMinutesSeconds( xd, xm, xs ), ACDegreesFromDegreesMinutesSeconds( yd, ym, ys )}
これはおそらくACVectorの緯度と経度の発生を説明することができます
ライブラリを含むACVectorのすべてのオカレンスを検索しましたが、定義されているACVectorの他のオカレンスを見つけることができませんでした