Move compat macros in 'lttng/align.h' to a private header
[lttng-ust.git] / libcounter / counter-api.h
index d18fa16ec4dab65e51091cb5e498fa2572736ea1..540bd11f2e75216310af63f50fe187c12e799deb 100644 (file)
@@ -1,27 +1,9 @@
 /*
- * counter/counter-api.h
- *
- * LTTng Counters API, requiring counter/config.h
+ * SPDX-License-Identifier: MIT
  *
  * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * LTTng Counters API, requiring counter/config.h
  */
 
 #ifndef _LTTNG_COUNTER_API_H
@@ -33,7 +15,7 @@
 #include "counter-internal.h"
 #include <urcu/compiler.h>
 #include <urcu/uatomic.h>
-#include <lttng/bitmap.h>
+#include "ust-bitmap.h"
 #include "../libringbuffer/getcpu.h"
 
 /*
@@ -101,6 +83,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && (v >= UINT8_MAX || n < old))
                        overflow = true;
@@ -140,6 +124,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && (v >= UINT16_MAX || n < old))
                        overflow = true;
@@ -179,6 +165,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && (v >= UINT32_MAX || n < old))
                        overflow = true;
@@ -219,6 +207,8 @@ static inline int __lttng_counter_add(const struct lib_counter_config *config,
                        } while (old != res);
                        break;
                }
+               default:
+                       return -EINVAL;
                }
                if (v > 0 && n < old)
                        overflow = true;
This page took 0.024521 seconds and 4 git commands to generate.