-rw-r--r-- | qmake/tools/qucom.cpp | 134 |
1 files changed, 5 insertions, 129 deletions
diff --git a/qmake/tools/qucom.cpp b/qmake/tools/qucom.cpp index 6086a79..658da97 100644 --- a/qmake/tools/qucom.cpp +++ b/qmake/tools/qucom.cpp | |||
@@ -297,6 +297,5 @@ void QUType_int::set( QUObject *o, int v ) | |||
297 | bool QUType_int::canConvertFrom( QUObject *o, QUType *t ) | 297 | bool QUType_int::canConvertFrom( QUObject *o, QUType *t ) |
298 | { | 298 | { |
299 | if ( isEqual( t, &static_QUType_double ) || | 299 | if ( isEqual( t, &static_QUType_double ) ) |
300 | isEqual( t, &static_QUType_float ) ) | ||
301 | return TRUE; | 300 | return TRUE; |
302 | 301 | ||
@@ -306,6 +305,5 @@ bool QUType_int::canConvertFrom( QUObject *o, QUType *t ) | |||
306 | bool QUType_int::canConvertTo( QUObject * /*o*/, QUType *t ) | 305 | bool QUType_int::canConvertTo( QUObject * /*o*/, QUType *t ) |
307 | { | 306 | { |
308 | return isEqual( t, &static_QUType_double ) || | 307 | return isEqual( t, &static_QUType_double ); |
309 | isEqual( t, &static_QUType_float ); | ||
310 | } | 308 | } |
311 | 309 | ||
@@ -314,6 +312,4 @@ bool QUType_int::convertFrom( QUObject *o, QUType *t ) | |||
314 | if ( isEqual( t, &static_QUType_double ) ) | 312 | if ( isEqual( t, &static_QUType_double ) ) |
315 | o->payload.i = (long)o->payload.d; | 313 | o->payload.i = (long)o->payload.d; |
316 | else if ( isEqual( t, &static_QUType_float ) ) | ||
317 | o->payload.i = (long)o->payload.f; | ||
318 | else | 314 | else |
319 | return t->convertTo( o, this ); | 315 | return t->convertTo( o, this ); |
@@ -328,7 +324,4 @@ bool QUType_int::convertTo( QUObject *o, QUType *t ) | |||
328 | o->payload.d = (double)o->payload.i; | 324 | o->payload.d = (double)o->payload.i; |
329 | o->type = &static_QUType_double; | 325 | o->type = &static_QUType_double; |
330 | } else if ( isEqual( t, &static_QUType_float ) ) { | ||
331 | o->payload.f = (float)o->payload.i; | ||
332 | o->type = &static_QUType_float; | ||
333 | } else | 326 | } else |
334 | return FALSE; | 327 | return FALSE; |
@@ -346,46 +339,4 @@ int QUType_int::serializeFrom( QUObject *, QUBuffer * ) | |||
346 | } | 339 | } |
347 | 340 | ||
348 | // {5938712A-C496-11D5-8CB2-00C0F03BC0F3} | ||
349 | const QUuid TID_QUType_uint( 0x5938712a, 0xc496, 0x11d5, 0x8c, 0xb2, 0x00, 0xc0, 0xf0, 0x3b, 0xc0, 0xf3); | ||
350 | QUType_uint static_QUType_uint; | ||
351 | const QUuid *QUType_uint::uuid() const { return &TID_QUType_uint; } | ||
352 | const char *QUType_uint::desc() const { return "uint"; } | ||
353 | |||
354 | void QUType_uint::set( QUObject *o, uint v ) | ||
355 | { | ||
356 | o->payload.ui = v; | ||
357 | o->type = this; | ||
358 | } | ||
359 | |||
360 | bool QUType_uint::canConvertFrom( QUObject *o, QUType *t ) | ||
361 | { | ||
362 | return t->canConvertTo( o, this ); | ||
363 | } | ||
364 | |||
365 | bool QUType_uint::canConvertTo( QUObject * /*o*/, QUType * /*t*/ ) | ||
366 | { | ||
367 | return FALSE; | ||
368 | } | ||
369 | |||
370 | bool QUType_uint::convertFrom( QUObject *o, QUType *t ) | ||
371 | { | ||
372 | return t->convertTo( o, this ); | ||
373 | } | ||
374 | |||
375 | bool QUType_uint::convertTo( QUObject * /*o*/, QUType * /*t*/ ) | ||
376 | { | ||
377 | return FALSE; | ||
378 | } | ||
379 | |||
380 | int QUType_uint::serializeTo( QUObject *, QUBuffer * ) | ||
381 | { | ||
382 | return 0; | ||
383 | } | ||
384 | |||
385 | int QUType_uint::serializeFrom( QUObject *, QUBuffer * ) | ||
386 | { | ||
387 | return 0; | ||
388 | } | ||
389 | |||
390 | // {2D0974E5-0BA6-4ec2-8837-C198972CB48C} | 341 | // {2D0974E5-0BA6-4ec2-8837-C198972CB48C} |
391 | const QUuid TID_QUType_double( 0x2d0974e5, 0xba6, 0x4ec2, 0x88, 0x37, 0xc1, 0x98, 0x97, 0x2c, 0xb4, 0x8c ); | 342 | const QUuid TID_QUType_double( 0x2d0974e5, 0xba6, 0x4ec2, 0x88, 0x37, 0xc1, 0x98, 0x97, 0x2c, 0xb4, 0x8c ); |
@@ -402,6 +353,5 @@ void QUType_double::set( QUObject *o, double v ) | |||
402 | bool QUType_double::canConvertFrom( QUObject *o, QUType *t ) | 353 | bool QUType_double::canConvertFrom( QUObject *o, QUType *t ) |
403 | { | 354 | { |
404 | if ( isEqual( t, &static_QUType_int ) || | 355 | if ( isEqual( t, &static_QUType_int ) ) |
405 | isEqual( t, &static_QUType_float) ) | ||
406 | return TRUE; | 356 | return TRUE; |
407 | 357 | ||
@@ -411,6 +361,5 @@ bool QUType_double::canConvertFrom( QUObject *o, QUType *t ) | |||
411 | bool QUType_double::canConvertTo( QUObject * /*o*/, QUType *t ) | 361 | bool QUType_double::canConvertTo( QUObject * /*o*/, QUType *t ) |
412 | { | 362 | { |
413 | return isEqual( t, &static_QUType_int ) || | 363 | return isEqual( t, &static_QUType_int ); |
414 | isEqual( t, &static_QUType_float ); | ||
415 | } | 364 | } |
416 | 365 | ||
@@ -419,6 +368,4 @@ bool QUType_double::convertFrom( QUObject *o, QUType *t ) | |||
419 | if ( isEqual( t, &static_QUType_int ) ) | 368 | if ( isEqual( t, &static_QUType_int ) ) |
420 | o->payload.d = (double)o->payload.i; | 369 | o->payload.d = (double)o->payload.i; |
421 | else if ( isEqual( t, &static_QUType_float ) ) | ||
422 | o->payload.d = (double)o->payload.f; | ||
423 | else | 370 | else |
424 | return t->convertTo( o, this ); | 371 | return t->convertTo( o, this ); |
@@ -451,68 +398,4 @@ int QUType_double::serializeFrom( QUObject *, QUBuffer * ) | |||
451 | } | 398 | } |
452 | 399 | ||
453 | |||
454 | // {544C5175-6993-4486-B04D-CEC4D21BF4B9 } | ||
455 | const QUuid TID_QUType_float( 0x544c5175, 0x6993, 0x4486, 0xb0, 0x4d, 0xce, 0xc4, 0xd2, 0x1b, 0xf4, 0xb9 ); | ||
456 | QUType_float static_QUType_float; | ||
457 | const QUuid *QUType_float::uuid() const { return &TID_QUType_float; } | ||
458 | const char *QUType_float::desc() const {return "float"; } | ||
459 | |||
460 | void QUType_float::set( QUObject *o, float v ) | ||
461 | { | ||
462 | o->payload.f = v; | ||
463 | o->type = this; | ||
464 | } | ||
465 | |||
466 | bool QUType_float::canConvertFrom( QUObject *o, QUType *t ) | ||
467 | { | ||
468 | if ( isEqual( t, &static_QUType_int ) || | ||
469 | isEqual( t, &static_QUType_double ) ) | ||
470 | return TRUE; | ||
471 | |||
472 | return t->canConvertTo( o, this ); | ||
473 | } | ||
474 | |||
475 | bool QUType_float::canConvertTo( QUObject * /*o*/, QUType *t ) | ||
476 | { | ||
477 | return isEqual( t, &static_QUType_int ) || | ||
478 | isEqual( t, &static_QUType_double ); | ||
479 | } | ||
480 | |||
481 | bool QUType_float::convertFrom( QUObject *o, QUType *t ) | ||
482 | { | ||
483 | if ( isEqual( t, &static_QUType_int ) ) | ||
484 | o->payload.f = (float)o->payload.i; | ||
485 | else if ( isEqual( t, &static_QUType_double ) ) | ||
486 | o->payload.f = (float)o->payload.d; | ||
487 | else | ||
488 | return t->convertTo( o, this ); | ||
489 | |||
490 | o->type = this; | ||
491 | return TRUE; | ||
492 | } | ||
493 | |||
494 | bool QUType_float::convertTo( QUObject *o, QUType *t ) | ||
495 | { | ||
496 | if ( isEqual( t, &static_QUType_int ) ) { | ||
497 | o->payload.i = (int) o->payload.f; | ||
498 | o->type = &static_QUType_int; | ||
499 | } else if ( isEqual( t, &static_QUType_double ) ) { | ||
500 | o->payload.d = (double) o->payload.f; | ||
501 | o->type = &static_QUType_double; | ||
502 | } else | ||
503 | return FALSE; | ||
504 | return TRUE; | ||
505 | } | ||
506 | |||
507 | int QUType_float::serializeTo( QUObject *, QUBuffer * ) | ||
508 | { | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | int QUType_float::serializeFrom( QUObject *, QUBuffer * ) | ||
513 | { | ||
514 | return 0; | ||
515 | } | ||
516 | |||
517 | // {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9} | 400 | // {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9} |
518 | const QUuid TID_QUType_charstar( 0xefcdd1d4, 0x77a3, 0x4b8e, 0x8d, 0x46, 0xdc, 0x14, 0xb8, 0xd3, 0x93, 0xe9 ); | 401 | const QUuid TID_QUType_charstar( 0xefcdd1d4, 0x77a3, 0x4b8e, 0x8d, 0x46, 0xdc, 0x14, 0xb8, 0xd3, 0x93, 0xe9 ); |
@@ -594,5 +477,4 @@ bool QUType_QString::canConvertFrom( QUObject *o, QUType *t ) | |||
594 | if ( isEqual( t, &static_QUType_charstar ) || | 477 | if ( isEqual( t, &static_QUType_charstar ) || |
595 | isEqual( t, &static_QUType_double ) || | 478 | isEqual( t, &static_QUType_double ) || |
596 | isEqual( t, &static_QUType_float ) || | ||
597 | isEqual( t, &static_QUType_int ) ) | 479 | isEqual( t, &static_QUType_int ) ) |
598 | return TRUE; | 480 | return TRUE; |
@@ -605,6 +487,5 @@ bool QUType_QString::canConvertTo( QUObject * /*o*/, QUType *t ) | |||
605 | return isEqual( t, &static_QUType_charstar ) || | 487 | return isEqual( t, &static_QUType_charstar ) || |
606 | isEqual( t, &static_QUType_int ) || | 488 | isEqual( t, &static_QUType_int ) || |
607 | isEqual( t, &static_QUType_double ) || | 489 | isEqual( t, &static_QUType_double ); |
608 | isEqual( t, &static_QUType_float ); | ||
609 | } | 490 | } |
610 | 491 | ||
@@ -616,6 +497,4 @@ bool QUType_QString::convertFrom( QUObject *o, QUType *t ) | |||
616 | else if ( isEqual( t, &static_QUType_double ) ) | 497 | else if ( isEqual( t, &static_QUType_double ) ) |
617 | str = new QString( QString::number( o->payload.d ) ); | 498 | str = new QString( QString::number( o->payload.d ) ); |
618 | else if ( isEqual( t, &static_QUType_float ) ) | ||
619 | str = new QString( QString::number( o->payload.f ) ); | ||
620 | else if ( isEqual( t, &static_QUType_int ) ) | 499 | else if ( isEqual( t, &static_QUType_int ) ) |
621 | str = new QString( QString::number( o->payload.i ) ); | 500 | str = new QString( QString::number( o->payload.i ) ); |
@@ -642,7 +521,4 @@ bool QUType_QString::convertTo( QUObject *o, QUType *t ) | |||
642 | o->payload.d = str->toDouble(); | 521 | o->payload.d = str->toDouble(); |
643 | o->type = &static_QUType_double; | 522 | o->type = &static_QUType_double; |
644 | } else if ( isEqual( t, &static_QUType_float ) ) { | ||
645 | o->payload.d = str->toFloat(); | ||
646 | o->type = &static_QUType_float; | ||
647 | } else { | 523 | } else { |
648 | return FALSE; | 524 | return FALSE; |