sk_c_from_to.h 791 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright 2015 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. static bool find_sk(CType from, SKType* to) {
  8. for (size_t i = 0; i < SK_ARRAY_COUNT(CTypeSkTypeMap); ++i) {
  9. if (CTypeSkTypeMap[i].fC == from) {
  10. if (to) {
  11. *to = CTypeSkTypeMap[i].fSK;
  12. }
  13. return true;
  14. }
  15. }
  16. return false;
  17. }
  18. static bool find_c(SKType from, CType* to) {
  19. for (size_t i = 0; i < SK_ARRAY_COUNT(CTypeSkTypeMap); ++i) {
  20. if (CTypeSkTypeMap[i].fSK == from) {
  21. if (to) {
  22. *to = CTypeSkTypeMap[i].fC;
  23. }
  24. return true;
  25. }
  26. }
  27. return false;
  28. }
  29. #undef CType
  30. #undef SKType
  31. #undef CTypeSkTypeMap