Skip to content

Commit f368c32

Browse files
committed
Updated LLTL hashing specifications
1 parent 9a06cc8 commit f368c32

File tree

3 files changed

+128
-53
lines changed

3 files changed

+128
-53
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*******************************************************************************
44

55
=== 1.0.31 ===
6+
* Updated LLTL hashing specifications.
67
* Fixed $XDG_CONFIG_HOME being ignored.
78

89
=== 1.0.30 ===

include/lsp-plug.in/io/Path.h

Lines changed: 63 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-runtime-lib
66
* Created on: 8 февр. 2019 г.
@@ -541,40 +541,77 @@ namespace lsp
541541
// LLTL specialization for Path class
542542
namespace lltl
543543
{
544+
// Non-const specification
544545
template <>
545-
struct hash_spec<io::Path>: public hash_iface
546+
struct hash_spec<io::Path>: public hash_iface
547+
{
548+
static size_t hash_func(const void *ptr, size_t size);
549+
550+
explicit hash_spec()
546551
{
547-
static size_t hash_func(const void *ptr, size_t size);
552+
hash = hash_func;
553+
}
554+
};
548555

549-
explicit hash_spec()
550-
{
551-
hash = hash_func;
552-
}
553-
};
556+
template <>
557+
struct compare_spec<io::Path>: public compare_iface
558+
{
559+
static ssize_t cmp_func(const void *a, const void *b, size_t size);
560+
561+
explicit compare_spec()
562+
{
563+
compare = cmp_func;
564+
}
565+
};
554566

555567
template <>
556-
struct compare_spec<io::Path>: public compare_iface
568+
struct allocator_spec<io::Path>: public allocator_iface
569+
{
570+
static void *clone_func(const void *src, size_t size);
571+
static void free_func(void *ptr);
572+
573+
explicit allocator_spec()
557574
{
558-
static ssize_t cmp_func(const void *a, const void *b, size_t size);
575+
clone = clone_func;
576+
free = free_func;
577+
}
578+
};
559579

560-
explicit compare_spec()
561-
{
562-
compare = cmp_func;
563-
}
564-
};
580+
// Const specification
581+
template <>
582+
struct hash_spec<const io::Path>: public hash_iface
583+
{
584+
static size_t hash_func(const void *ptr, size_t size);
585+
586+
explicit hash_spec()
587+
{
588+
hash = hash_func;
589+
}
590+
};
565591

566592
template <>
567-
struct allocator_spec<io::Path>: public allocator_iface
593+
struct compare_spec<const io::Path>: public compare_iface
594+
{
595+
static ssize_t cmp_func(const void *a, const void *b, size_t size);
596+
597+
explicit compare_spec()
568598
{
569-
static void *clone_func(const void *src, size_t size);
570-
static void free_func(void *ptr);
571-
572-
explicit allocator_spec()
573-
{
574-
clone = clone_func;
575-
free = free_func;
576-
}
577-
};
599+
compare = cmp_func;
600+
}
601+
};
602+
603+
template <>
604+
struct allocator_spec<const io::Path>: public allocator_iface
605+
{
606+
static void *clone_func(const void *src, size_t size);
607+
static void free_func(void *ptr);
608+
609+
explicit allocator_spec()
610+
{
611+
clone = clone_func;
612+
free = free_func;
613+
}
614+
};
578615
} /* namespace lltl */
579616
} /* namespace lsp */
580617

include/lsp-plug.in/runtime/LSPString.h

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3-
* (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
44
*
55
* This file is part of lsp-runtime-lib
66
* Created on: 30 авг. 2017 г.
@@ -696,41 +696,78 @@ namespace lsp
696696
// LLTL specialization for String class
697697
namespace lltl
698698
{
699+
// Non-const specifications
699700
template <>
700-
struct hash_spec<LSPString>: public hash_iface
701+
struct hash_spec<LSPString>: public hash_iface
702+
{
703+
static size_t hash_func(const void *ptr, size_t size);
704+
705+
explicit hash_spec()
701706
{
702-
static size_t hash_func(const void *ptr, size_t size);
707+
hash = hash_func;
708+
}
709+
};
710+
711+
template <>
712+
struct compare_spec<LSPString>: public compare_iface
713+
{
714+
static ssize_t cmp_func(const void *a, const void *b, size_t size);
703715

704-
explicit hash_spec()
705-
{
706-
hash = hash_func;
707-
}
708-
};
716+
explicit compare_spec()
717+
{
718+
compare = cmp_func;
719+
}
720+
};
709721

710722
template <>
711-
struct compare_spec<LSPString>: public compare_iface
723+
struct allocator_spec<LSPString>: public allocator_iface
724+
{
725+
static void *clone_func(const void *src, size_t size);
726+
static void free_func(void *ptr);
727+
728+
explicit allocator_spec()
712729
{
713-
static ssize_t cmp_func(const void *a, const void *b, size_t size);
730+
clone = clone_func;
731+
free = free_func;
732+
}
733+
};
714734

715-
explicit compare_spec()
716-
{
717-
compare = cmp_func;
718-
}
719-
};
735+
// Const specifications
736+
template <>
737+
struct hash_spec<const LSPString>: public hash_iface
738+
{
739+
static size_t hash_func(const void *ptr, size_t size);
740+
741+
explicit hash_spec()
742+
{
743+
hash = hash_func;
744+
}
745+
};
746+
747+
template <>
748+
struct compare_spec<const LSPString>: public compare_iface
749+
{
750+
static ssize_t cmp_func(const void *a, const void *b, size_t size);
751+
752+
explicit compare_spec()
753+
{
754+
compare = cmp_func;
755+
}
756+
};
720757

721758
template <>
722-
struct allocator_spec<LSPString>: public allocator_iface
759+
struct allocator_spec<const LSPString>: public allocator_iface
760+
{
761+
static void *clone_func(const void *src, size_t size);
762+
static void free_func(void *ptr);
763+
764+
explicit allocator_spec()
723765
{
724-
static void *clone_func(const void *src, size_t size);
725-
static void free_func(void *ptr);
726-
727-
explicit allocator_spec()
728-
{
729-
clone = clone_func;
730-
free = free_func;
731-
}
732-
};
733-
}
766+
clone = clone_func;
767+
free = free_func;
768+
}
769+
};
770+
} /* namespace lltl */
734771

735772
} /* namespace lsp */
736773

0 commit comments

Comments
 (0)