@@ -808,7 +808,7 @@ void Recording::writeMetadata(Buffer *buf) {
808808
809809 std::vector<std::string> &strings = JfrMetadata::strings ();
810810 buf->putVar64 (strings.size ());
811- for (int i = 0 ; i < strings.size (); i++) {
811+ for (size_t i = 0 ; i < strings.size (); i++) {
812812 const char *string = strings[i].c_str ();
813813 int length = strlen (string);
814814 flushIfNeeded (buf, RECORDING_BUFFER_LIMIT - length);
@@ -842,14 +842,14 @@ void Recording::writeElement(Buffer *buf, const Element *e) {
842842 buf->putVar64 (e->_name );
843843
844844 buf->putVar64 (e->_attributes .size ());
845- for (int i = 0 ; i < e->_attributes .size (); i++) {
845+ for (size_t i = 0 ; i < e->_attributes .size (); i++) {
846846 flushIfNeeded (buf);
847847 buf->putVar64 (e->_attributes [i]._key );
848848 buf->putVar64 (e->_attributes [i]._value );
849849 }
850850
851851 buf->putVar64 (e->_children .size ());
852- for (int i = 0 ; i < e->_children .size (); i++) {
852+ for (size_t i = 0 ; i < e->_children .size (); i++) {
853853 flushIfNeeded (buf);
854854 writeElement (buf, e->_children [i]);
855855 }
@@ -1426,7 +1426,7 @@ void Recording::writeCounters(Buffer *buf) {
14261426 long long *counters = Counters::getCounters ();
14271427 if (counters) {
14281428 std::vector<const char *> names = Counters::describeCounters ();
1429- for (int i = 0 ; i < names.size (); i++) {
1429+ for (size_t i = 0 ; i < names.size (); i++) {
14301430 int start = buf->skip (1 );
14311431 buf->putVar64 (T_DATADOG_COUNTER);
14321432 buf->putVar64 (_start_ticks);
@@ -1683,10 +1683,11 @@ void FlightRecorder::stop() {
16831683}
16841684
16851685Error FlightRecorder::dump (const char *filename, const int length) {
1686+ assert (length >= 0 );
16861687 ExclusiveLockGuard locker (&_rec_lock);
16871688 Recording* rec = _rec;
16881689 if (rec != nullptr ) {
1689- if (_filename.length () != length ||
1690+ if (_filename.length () != static_cast < size_t >( length) ||
16901691 strncmp (filename, _filename.c_str (), length) != 0 ) {
16911692 // if the filename to dump the recording to is specified move the current
16921693 // working file there
0 commit comments